[Lldb-commits] [PATCH] D94077: Support unscoped enumeration members in the expression evaluator.

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 5 10:30:59 PST 2021


shafik added a comment.

We can have unscoped enums in namespace and class scope and the enumerators won't leak out from those scopes. Thus we can have shadowing going on e.g.:

  #include <iostream>
  
  enum GEnum {eOne=2,};
  
  namespace A {
     enum AEnum {eOne=0,};
  
    void g() {std::cout << eOne;}
  };
  
  struct B {
    enum CEnum {eOne=1,};
  
    void f() {std::cout << eOne;}
  };
  
  int main() {
     std::cout << eOne ;
     A::g() ;
  
     B b;
     b.f() ;
  }

godbolt: https://godbolt.org/z/h3r76n

How does this change deal with those cases?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94077/new/

https://reviews.llvm.org/D94077



More information about the lldb-commits mailing list