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++/53412] New: Error recovery for class types is poor


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

             Bug #: 53412
           Summary: Error recovery for class types is poor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Take:
#include <vector>
std::vector<i*> a;
void f(int*b)
{
a.pushback(b);
}

--- CUT---
On the trunk we get the following error messages:
t344.cc:3:13: error: âiâ was not declared in this scope
 std::vector<i*> a;
             ^
t344.cc:3:15: error: template argument 1 is invalid
 std::vector<i*> a;
               ^
t344.cc:3:15: error: template argument 2 is invalid
 std::vector<i*> a;
               ^
t344.cc:3:18: error: invalid type in declaration before â;â token
 std::vector<i*> a;
                  ^
t344.cc: In function âvoid f(int*)â:
t344.cc:7:3: error: request for member âpushbackâ in âaâ, which is of non-class
type âintâ
 a.pushback(b);
   ^


--- CUT ---
The last one seems just plain wrong.  Why did the C++ front-end record a as
type int rather than using error_mark_node? 
Also the fourth error message seems wrong too as we already have an error that
the type was invalid.
The second and third ones are not really needed for default template arguments
if we already have an error out about the non defaulted ones.


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