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++/24630] New: friend injection fails


template<typename T>
struct  foo {
    template<typename U>
    friend
    foo<T>  f1(U u) {}

    template<typename TT, typename U>
    friend
    foo<TT> f2(U u) {}
    };
int main  () {
    bool b;
    f1<int>(b);
    f2<int>(b);
    }


gets you:

~/ootbc/members/src$ g++ foo.cc
foo.cc: In function `int main()':
foo.cc:13: error: `f1' undeclared (first use this function)
foo.cc:13: error: (Each undeclared identifier is reported only once for each
function it appears in.)
foo.cc:13: error: expected primary-expression before "int"
foo.cc:13: error: expected `;' before "int"
foo.cc:14: error: `f2' undeclared (first use this function)
foo.cc:14: error: expected primary-expression before "int"
foo.cc:14: error: expected `;' before "int"


Ivan


-- 
           Summary: friend injection fails
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24630


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