This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17867] New: [4.0 regression] "void" instead of class name in error message


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]