public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16068] New: Bad error message
@ 2004-06-18 23:33 igodard at pacbell dot net
2004-06-19 1:13 ` [Bug c++/16068] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: igodard at pacbell dot net @ 2004-06-18 23:33 UTC (permalink / raw)
To: gcc-bugs
In:
#include <iostream>
class A{};
template<typename T>
void operator<<(const A&, const T& t) {}
int main() {
A a;
a << std::endl;
}
You get the message:
~/ootbc/common/test/src$ g++ foo1.cc
foo1.cc: In function `int main()':
foo1.cc:9: error: no match for 'operator<<' in 'a << std::endl'
While there is an error here, it is that there are multiple matches (endl is an overloaded function, all of which match) and is ambiguous, rather than that there are no matches. The error should should the usual unresolvable ambiguity message listing the ambiguous identifications.
This bug is related to #16058, which was (incorrectly) reported as an indentification error as a result of a message like this.
Ivan
--
Summary: Bad error message
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16068
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16068] Bad error message
2004-06-18 23:33 [Bug c++/16068] New: Bad error message igodard at pacbell dot net
@ 2004-06-19 1:13 ` pinskia at gcc dot gnu dot org
2004-06-19 1:21 ` pinskia at gcc dot gnu dot org
2005-03-04 7:51 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-19 1:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-19 01:13 -------
ICC 6.0 gives:
pr16070.cc
pr16070.cc(9): error: no operator "<<" matches these operands
operand types are: A << <unknown-type>
a << f;
^
compilation aborted for pr16070.cc (code 2)
Reduced:
template <class T> void f(T);
class A{};
template<typename T>
void operator<<(const A&, const T& t) {}
int main() { A a; a << f; }
3.0.4 and 2.95.3 gives:
tin:~/src/gnu/gcctest>~/ia32_linux_gcc3_0/bin/gcc pr16070.cc
pr16070.cc: In function `int main()':
pr16070.cc:9: no match for `A& << <unknown type>' operator
tin:~/src/gnu/gcctest>~/ia32_linux_gcc2_95//bin/gcc pr16070.cc
pr16070.cc: In function `int main()':
pr16070.cc:9: no match for `A & << {unknown type}'
They are slightly better but still bad (really ICC's diagnostic is just as bad as GCC's here).
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2004-06-19 01:13:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16068
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16068] Bad error message
2004-06-18 23:33 [Bug c++/16068] New: Bad error message igodard at pacbell dot net
2004-06-19 1:13 ` [Bug c++/16068] " pinskia at gcc dot gnu dot org
@ 2004-06-19 1:21 ` pinskia at gcc dot gnu dot org
2005-03-04 7:51 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-19 1:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-19 01:21 -------
*** Bug 16069 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16068
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16068] Bad error message
2004-06-18 23:33 [Bug c++/16068] New: Bad error message igodard at pacbell dot net
2004-06-19 1:13 ` [Bug c++/16068] " pinskia at gcc dot gnu dot org
2004-06-19 1:21 ` pinskia at gcc dot gnu dot org
@ 2005-03-04 7:51 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-04 7:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-04 07:51 -------
*** Bug 20311 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16068
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16068] Bad error message
[not found] <bug-16068-6594@http.gcc.gnu.org/bugzilla/>
@ 2005-10-04 2:31 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-04 2:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-10-04 02:31 -------
Fixed by:
* error.c (dump_type) <UNKNOWN_TYPE>: Print reworded message.
* g++.dg/overload/unknown1.C: New.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16068
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-10-04 2:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-18 23:33 [Bug c++/16068] New: Bad error message igodard at pacbell dot net
2004-06-19 1:13 ` [Bug c++/16068] " pinskia at gcc dot gnu dot org
2004-06-19 1:21 ` pinskia at gcc dot gnu dot org
2005-03-04 7:51 ` pinskia at gcc dot gnu dot org
[not found] <bug-16068-6594@http.gcc.gnu.org/bugzilla/>
2005-10-04 2:31 ` 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).