public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105483] New: injected-class-name and constructors diagnostic
@ 2022-05-04 16:20 mpolacek at gcc dot gnu.org
  2022-11-02 17:16 ` [Bug c++/105483] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-04 16:20 UTC (permalink / raw)
  To: gcc-bugs

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;
     ^

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-07 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 16:20 [Bug c++/105483] New: injected-class-name and constructors diagnostic mpolacek at gcc dot gnu.org
2022-11-02 17:16 ` [Bug c++/105483] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org
2022-12-20 13:40 ` rguenth at gcc dot gnu.org
2022-12-27 14:18 ` [Bug c++/105483] [10/11/12/13 Regression] injected-class-name and constructors diagnostic since r8-1739-g3b5c768c40c78618 marxin at gcc dot gnu.org
2023-07-07 10:43 ` [Bug c++/105483] [11/12/13/14 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).