Details
-
Bug
-
Resolution: Unresolved
-
High
-
None
-
6.22/02
-
None
-
Centos7, gcc8
Description
As reported by wlampl, non-scoped enum values are not accessible in the namespace where the enum belongs when loading a dictionary. The value is accessible via the enum name, though.
For example:
root [0] gSystem->Load("libRingerSelectorToolsEnumsDict.so")
|
(int) 0
|
root [1] Ringer::Loose
|
ROOT_prompt_1:1:9: error: no member named 'Loose' in namespace 'Ringer'
|
Ringer::Loose
|
~~~~~~~~^
|
root [2] Ringer::Requirement::Loose
|
(Ringer::Requirement) (Ringer::Requirement::Loose) : (unsigned int) 13
|
However, including the header where the enum is defined does have the expected behaviour:
root [0] #include "RingerSelectorToolsEnums.h"
|
root [1] Ringer::Loose
|
(Ringer::Requirement) (Ringer::Requirement::Loose) : (unsigned int) 13
|
root [2] Ringer::Requirement::Loose
|
(Ringer::Requirement) (Ringer::Requirement::Loose) : (unsigned int) 13
|
This also affects PyROOT, where the equivalent behaviour can be observed, e.g. :
import cppyy |
cppyy.load_library('libRingerSelectorToolsEnumsDict') |
from ROOT import Ringer |
Ringer.Requirement.Loose # ok |
Ringer.Loose # throws attribute error |
The header used above can be accessed here:
https://gitlab.cern.ch/atlas/athena/-/blob/master/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/RingerSelectorToolsEnums.h