[clang] Fix scope of typedefs present inside a template class (PR #146729)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 15 02:56:57 PDT 2025


Michael137 wrote:

Yea this even works when the typedef is not template-dependent but used outside of the class only:
```
template <typename T = int>
struct Y {                 
  typedef int outside;     
  int o;                   
};                         
                           
Y<> y;                     
Y<>::outside g;           
```

Again, in this case the `TypedefDecl`s `DeclContext` is the `ClassTemplateSpecializationDecl`. So why is it only an issue when the typedef is not template-dependent but is used as the type of a field?

https://github.com/llvm/llvm-project/pull/146729


More information about the cfe-commits mailing list