This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25751] New: Poor error when templating on undefined types
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jan 2006 15:22:44 -0000
- Subject: [Bug c++/25751] New: Poor error when templating on undefined types
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#include <vector>
int main(void)
{
std::vector<foo> v;
v.begin();
}
Produces:
temp.cc: In function 'int main()':
temp.cc:5: error: 'foo' was not declared in this scope
temp.cc:5: error: template argument 1 is invalid
temp.cc:5: error: template argument 2 is invalid
temp.cc:5: error: invalid type in declaration before ';' token
temp.cc:6: error: request for member 'begin' in 'v', which is of non-class type
'int'
That last warning doesn't seem to make any sense. Perhaps g++ should abandon
parsing / producing errors earlier?
--
Summary: Poor error when templating on undefined types
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chris at bubblescope dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25751