[llvm-bugs] [Bug 48002] New: Struct declarated by elaborated type specifier inside another struct.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 28 11:56:19 PDT 2020


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

            Bug ID: 48002
           Summary: Struct declarated by elaborated type specifier inside
                    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 = B;   
  }

Compile it with "-std=c++20 -pedantic-errors".

Clang rejects it with the following error 
message: "unknown type name 'B': using U = B;".

Note that the gcc compiler correctly accepts it.

I tried to report this as a gcc bug before, but it turned out that the gcc
behaviour is correct ( see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97569
).

-- 
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/20201028/0c374bb6/attachment.html>


More information about the llvm-bugs mailing list