C++14 support by rootcling

Dear all,

In a library I am building against, a header contains the following line :

[[deprecated("Use file back-end instantiated through ConfigurationFactory instead")]]

As a consequence I get this error :

[quote][ 93%] Building CXX object QualityControlModules/Common/src/CMakeFiles/QcCommon.dir/QcCommonDict.cxx.o
In file included from input_line_12:8:
In file included from /home/bvonhall/hackathon/QualityControlModules/Example/include/Example/BenchmarkTask.h:12:
/home/bvonhall/Configuration/lib/…/include/Configuration/Configuration.h:31:1: error: an attribute list cannot appear
here
[[deprecated(“Use file back-end instantiated through ConfigurationFactory instead”)]]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: /shareFS/flpproto_deps-9-2-17/bin/rootcling: compilation failure (./QcExampleDict416242023d_dictUmbrella.h)
[/quote]

Is it because rootcling does not support C++14 features ?

I built ROOT itself using the same compiler, gcc 6.2.1 from devtoolset-6.

Thank you in advance for your help.
Barth

PS: I can’t search the forum for “c++14”

Hi Barth,

rootcling supports what cling supports which is what clang support. What is needed is a C++14 enabled ROOT build (root.cern.ch/building-root).

Cheers,
D

Hi,
Thank you, I missed this flag.
Cheers,
Barth

Hi,
Coming back to this issue. I am now sure that I compile ROOT with the proper flag :

[bvonhall@pcald02a flpproto]$ root-config --has-cxx14
yes

However I still get

In file included from input_line_12:17:
/home/local/alice/sw/slc7_x86-64/Configuration/master-4/lib/../include/Configuration/Configuration.h:31:1: error: an
      attribute list cannot appear here
[[deprecated("Use file back-end instantiated through ConfigurationFactory instead")]]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: /home/local/alice/sw/slc7_x86-64/ROOT/v6-08-02_O2_DAQ-4/bin/rootcint: compilation failure (/home/local/alice/sw/BUILD/0462a3208d5945a00d12b2e31a3ad1e2a29d0176/flpproto/QualityControlModules/Example/G__QcExampleDict4bada267a5_dictUmbrella.h)
QualityControlModules/Example/CMakeFiles/QcExample.dir/build.make:64: recipe for target 'QualityControlModules/Example/G__QcExampleDict.cxx' failed
make[2]: *** [QualityControlModules/Example/G__QcExampleDict.cxx] Error 1
make[2]: Leaving directory '/home/local/alice/sw/BUILD/0462a3208d5945a00d12b2e31a3ad1e2a29d0176/flpproto'
CMakeFiles/Makefile2:3996: recipe for target 'QualityControlModules/Example/CMakeFiles/QcExample.dir/all' failed
make[1]: *** [QualityControlModules/Example/CMakeFiles/QcExample.dir/all] Error 2
make[1]: Leaving directory '/home/local/alice/sw/BUILD/0462a3208d5945a00d12b2e31a3ad1e2a29d0176/flpproto'
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

The line which is deprecated is in a header that I include in my code for which a dictionary is being generated.

Any hint ?
Thank you

Hi Barth,

Can you post the relevant code showing the annotation?

Axel

Hi Axel,

Here is the piece of code in the header I include :

[[deprecated("Use file back-end instantiated through ConfigurationFactory instead")]]
class ConfigFile
{
// ...

Cheers,
Barth

Should this not be class [[deprecated("...")]] ConfigFile {?

Cheers, Axel

Correct !

I did not realize that. Thank you very much Axel.