https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105483
Bug ID: 105483 Summary: injected-class-name and constructors diagnostic Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- Consider: struct X { }; void g () { X::X x; } for which we emit d.cc: In function ‘void g()’: d.cc:6:3: error: ‘X::__ct ’ names the constructor, not the type 6 | X::X x; | ^ d.cc:6:7: error: expected ‘;’ before ‘x’ 6 | X::X x; | ^~ | ; d.cc:6:9: error: statement cannot resolve address of overloaded function 6 | X::X x; | ^ which is too verbose and prints the internal "__ct" name. For comparison: $ xclang++ -c d.cc d.cc:6:6: error: qualified reference to 'X' is a constructor name rather than a type in this context X::X x; ^