Enum in namespace not available after loading dictionary


This issue is a follow-up of a previous post of mine. In the first part of that thread I describe how an enum class inside a namespace is not available in the root shell, even after loading its dictionary, and the only way to make it available is to load the rootmap (e.g starting the shell from the folder where the dictionary library and the rootmap are) or manually load the header where the enum class is defined.
I’m still facing the same issue with a modern Root version so I wonder whether this is intended behavior or a bug (and eventually if it is going to be fixed).
Thanks.

ROOT Version: 6.22.08
Platform: Archlinux
Compiler: GCC 11.1.0


I guess @axel can help you.

The issue of not being able to store such an enum is fixed, right? (Referring to https://sft.its.cern.ch/jira/browse/ROOT-10171 here.)

The interpreter tries really hard to not parse headers - that’s costly, so it tries to find information elsewhere. Please add #pragma link C++ namespace NS; to make the namespace known to ROOT.

Hi Axel, honestly I lost track of the storing issue. We worked that around a few time ago, so I have to check from scratch; will do that in a while and report back directly on JIRA.

About the pragma, that doesn’t seem to help at all. It is already present in the reproducer attached to the original thread, but it does not fix this issue.

Argh sorry indeed, forgot to move the rootmap file! I’m checking.

[dictgen] Also forward declare namespaces, typedefs, enums: by Axel-Naumann · Pull Request #8661 · root-project/root · GitHub should be fixing the issue of the unknown namespace in the ROOT prompt after loading the library. Can you confirm that it fixes also your case? If you prefer we can get that PR merged first and you confirm with a nightly build of ROOT.

(I confused this and the I/O enum issue ROOT-10171 - apologies for the noise.)

@Axel I tried the reproducer with Root commit 22a84ec3fceb from your dict-fwd-decl-ns-td-enum branch. I confirm that it fixes the issue almost completely, the only leftover being that double tab does not work (i.e. root[0] NS:: <tab> <tab> does not autocomplete nor shows a list of available names in the namespace as it does when the rootmap file is loaded).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.