Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gDirectory macro should include global-namespace qualification #12623

Closed
1 task done
knoepfel opened this issue Apr 5, 2023 · 1 comment · Fixed by #12624
Closed
1 task done

gDirectory macro should include global-namespace qualification #12623

knoepfel opened this issue Apr 5, 2023 · 1 comment · Fixed by #12624

Comments

@knoepfel
Copy link
Contributor

knoepfel commented Apr 5, 2023

  • 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

  1. Version: ROOT 6.26/06
  2. Operating system: CentOS 7
  3. Built from source
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Hi @pcanal,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

@pcanal pcanal added this to Issues in Fixed in 6.30/00 via automation Apr 6, 2023
@pcanal pcanal added this to the 6.30/00 milestone Apr 6, 2023
@pcanal pcanal added this to Issues in Fixed in 6.28/04 via automation Apr 6, 2023
@pcanal pcanal added this to Issues in Fixed in 6.26/12 via automation Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants