public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25751] New: Poor error when templating on undefined types
@ 2006-01-11 15:22 chris at bubblescope dot net
2006-02-02 19:47 ` [Bug c++/25751] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 4+ messages in thread
From: chris at bubblescope dot net @ 2006-01-11 15:22 UTC (permalink / raw)
To: gcc-bugs
#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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/25751] Poor error when templating on undefined types
2006-01-11 15:22 [Bug c++/25751] New: " chris at bubblescope dot net
@ 2006-02-02 19:47 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-02 19:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-02-02 19:47 -------
Confirmed.
What should happen here is that when foo is not declared in this context, we
should try to figure out if it was going to be used as a type or a variable.
Right now we assume it is used as a variable.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-02-02 19:47:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25751
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-07 5:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-25751-4@http.gcc.gnu.org/bugzilla/>
2012-05-24 15:25 ` [Bug c++/25751] Poor error when templating on undefined types paolo.carlini at oracle dot com
2012-05-24 15:30 ` paolo.carlini at oracle dot com
2022-01-07 5:56 ` pinskia at gcc dot gnu.org
2006-01-11 15:22 [Bug c++/25751] New: " chris at bubblescope dot net
2006-02-02 19:47 ` [Bug c++/25751] " pinskia 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).