Skip to content

[Clang] Duplicate diagnostics in C++20+ mode: incomplete type in nested name specifier #147000

@zwuis

Description

@zwuis

Clang emits duplicate diagnostics when compiling the following code in C++20+ mode:

struct incomplete;
incomplete::type var;

Output:

<source>:2:1: error: incomplete type 'incomplete' named in nested name specifier
    2 | incomplete::type var;
      | ^~~~~~~~~~~~
<source>:1:8: note: forward declaration of 'incomplete'
    1 | struct incomplete;
      |        ^
<source>:2:1: error: incomplete type 'incomplete' named in nested name specifier
    2 | incomplete::type var;
      | ^~~~~~~~~~~~
<source>:1:8: note: forward declaration of 'incomplete'
    1 | struct incomplete;
      |        ^

Compiler Explorer: https://godbolt.org/z/fPo1W7c1n

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions