Closed
Description
- Checked for duplicates
Describe the bug
The definition of gDirectory
as a macro causes problems when used inside of a namespace named ROOT
.
For example, the following fails to compile with GCC 9.3 and C++17:
#include "TDirectory.h"
namespace util::ROOT {
void foo() { auto path = gDirectory->GetPath(); }
}
Because gDirectory
expands to ROOT::Internal...
and not ::ROOT::Internal...
, C++ name lookup chooses util::ROOT
and notices that util::ROOT::Internal
is non-existent.
Expected behavior
The above should compile without ambiguity. A PR is forthcoming to address this limitation.
Setup
- Version: ROOT 6.26/06
- Operating system: CentOS 7
- Built from source