This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16069] New: Bad error message
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jun 2004 23:38:21 -0000
- Subject: [Bug c++/16069] New: Bad error message
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In:
#include <iostream>
class A{};
template<typename T>
void Foo(const T& t) {}
int main() {
A a;
Foo(std::endl);
}
you get:
~/ootbc/common/test/src$ g++ foo1.cc
foo1.cc: In function `int main()':
foo1.cc:9: error: no matching function for call to `Foo(<unknown type>)'
"unknown type" is pretty lame; there are actually several types here because endl is an overloaded function. The error is a template resolution ambiguity, and should be reported as such. This is related to bug #16068, which for unknown reasons produces a different (but still bad) message in the same circumstances but when applied to an operator rather than a function.
--
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=16069