[llvm-bugs] [Bug 52369] New: error taking typedef from nested class instead of parent class

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 31 05:39:46 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52369

            Bug ID: 52369
           Summary: error taking typedef from nested class instead of
                    parent class
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fchelnokov at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

This valid program (accepted by GCC):
```
template<class T> struct A {
  typedef int M;
  struct B {
    typedef void M;
    struct C;
  };
};

template<class T> struct A<T>::B::C : A<T> {
  M m;  // must be OK, A<T>​::​M
};
```
produces an error in Clang, because it takes M from A<T>::B instead of expected
A<T>. Demo: https://gcc.godbolt.org/z/cMTYboP1Y

Related discussion: https://gcc.godbolt.org/z/cMTYboP1Y

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211031/78cb796b/attachment-0001.html>


More information about the llvm-bugs mailing list