This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15625] New: Sails to find static function


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]