public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47929] New: unclear "prototype for '...' does not match any in class" diagnostic for templates
@ 2011-02-28 18:41 redi at gcc dot gnu.org
2013-11-10 5:13 ` [Bug c++/47929] " pinskia at gcc dot gnu.org
2021-08-04 6:33 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-28 18:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47929
Summary: unclear "prototype for '...' does not match any in
class" diagnostic for templates
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
Given the invalid code:
struct S
{
void f();
};
template<typename T>
void S::f()
{
}
G++ complains:
x.cc:7:6: error: prototype for 'void S::f()' does not match any in class 'S'
x.cc:3:10: error: candidate is: void S::f()
The error message doesn't indicate that one of the signatures is a template, it
might be helpful if it did.
(I have just spent about a minute being dumb and confused because the line with
"template<typename T>" was scrolled off the top of my editor window and I
couldn't see why the signatures didn't match!)
If the situation is reversed, so the declaration is a template but the
definition is not, the error message makes it obvious:
x.cc:7:6: error: prototype for 'void S::f()' does not match any in class 'S'
x.cc:4:12: error: candidate is: template<class T> void S::f()
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/47929] unclear "prototype for '...' does not match any in class" diagnostic for templates
2011-02-28 18:41 [Bug c++/47929] New: unclear "prototype for '...' does not match any in class" diagnostic for templates redi at gcc dot gnu.org
@ 2013-11-10 5:13 ` pinskia at gcc dot gnu.org
2021-08-04 6:33 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-11-10 5:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47929
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-11-10
Ever confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/47929] unclear "prototype for '...' does not match any in class" diagnostic for templates
2011-02-28 18:41 [Bug c++/47929] New: unclear "prototype for '...' does not match any in class" diagnostic for templates redi at gcc dot gnu.org
2013-11-10 5:13 ` [Bug c++/47929] " pinskia at gcc dot gnu.org
@ 2021-08-04 6:33 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04 6:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47929
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2013-11-10 00:00:00 |2021-8-3
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, only ICC produces the best error message.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-04 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-28 18:41 [Bug c++/47929] New: unclear "prototype for '...' does not match any in class" diagnostic for templates redi at gcc dot gnu.org
2013-11-10 5:13 ` [Bug c++/47929] " pinskia at gcc dot gnu.org
2021-08-04 6:33 ` pinskia at gcc dot gnu.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).