public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17867] New: [4.0 regression] "void" instead of class name in error message
@ 2004-10-06 19:06 reichelt at gcc dot gnu dot org
  2004-10-06 19:14 ` [Bug c++/17867] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-06 19:06 UTC (permalink / raw)
  To: gcc-bugs

Compiling the following invalid code snippet with "-pedantic" I get
a hosed error message on mainline:

==========================
struct A
{
    A(int);
};

const A& foo();

void bar()
{
    foo()=A(0);
}
==========================

The error message reads:

  bug.cc: In function `void bar()':
  bug.cc:10: error: no match for 'operator=' in 'foo() = void(0)'
                                                         ^^^^
  bug.cc:2: note: candidates are: A& A::operator=(const A&) <near match>


With 3.4.2 I get a correct message instead:

  bug.cc: In function `void bar()':
  bug.cc:10: error: no match for 'operator=' in 'foo() = A(0)'
                                                        ^^^
  bug.cc:2: note: candidates are: A& A::operator=(const A&) <near match>

-- 
           Summary: [4.0 regression] "void" instead of class name in error
                    message
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17867


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

end of thread, other threads:[~2004-10-10  5:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-06 19:06 [Bug c++/17867] New: [4.0 regression] "void" instead of class name in error message reichelt at gcc dot gnu dot org
2004-10-06 19:14 ` [Bug c++/17867] " pinskia at gcc dot gnu dot org
2004-10-07  0:10 ` reichelt at gcc dot gnu dot org
2004-10-10  0:04 ` mmitchel at gcc dot gnu dot org
2004-10-10  5:03 ` cvs-commit at gcc dot gnu dot org
2004-10-10  5:28 ` cvs-commit at gcc dot gnu dot org
2004-10-10  5:34 ` mmitchel at gcc dot gnu dot 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).