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: [email protected]
ReportedBy: [email protected]
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.