This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15625] New: Sails to find static function
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2004 01:34:57 -0000
- Subject: [Bug c++/15625] New: Sails to find static function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
enum Relation {equalOp};
template<typename B>
class A {
public:
static
bool Relop(const A&, const A&, Relation);
friend
bool operator==(const A& a1, const A& a2) {
return Relop(a1, a2, equalOp);
}
B* b;
};
int main() {
A<int> a; a == a;
return 0;
}
produces:
foo.cc: In function `bool operator==(const A<int>&, const A<int>&)':
foo.cc:16: instantiated from here
foo.cc:10: error: no matching function for call to `A<B>::Relop(const A<int>&, const A<int>&, Relation)'
foo.cc:6: note: candidates are: static bool A<B>::Relop(const A<B>&, const A<B>&, Relation)
Even if this code is actually invalid (who could tell except the committee?) the error message should at least indicate what is really wrong.
Ivan
--
Summary: Sails to find static function
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=15625