[llvm-bugs] [Bug 47964] New: Struct declared in a field declaration in another struct.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 25 09:59:48 PDT 2020


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

            Bug ID: 47964
           Summary: Struct declared in a field declaration in another
                    struct.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 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

Consider the following c++ program:

  int main()
  {
    struct A
    {
      struct B *b;
    };

    using U = A::B;
  }

Compiling it with "-std=c++20 -pedantic-errors" gives the following error
message:

  <source>:8:18: error: no type named 'B' in 'A'

      using U = A::B;

                ~~~^

This is strange. Doesn't  B  belong to the class scope of  A ? If not, to what
other scope does it blong?

-- 
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/20201025/47bdacfd/attachment.html>


More information about the llvm-bugs mailing list