[Bug c++/8355] befriending a template specialization in another namespace

gianni at mariani dot ws gcc-bugzilla@gcc.gnu.org
Fri Oct 1 17:46:00 GMT 2004


------- Additional Comments From gianni at mariani dot ws  2004-10-01 17:46 -------

gcc 3.4.2 complains about this as well:


namespace A {
template <typename T>
void func ()
{
    static T instance;
}
}


namespace blah {

class MyClass {
    friend void A::func<MyClass> ();

    MyClass () {} // private
};

}


int main ()
{
    A::func<blah::MyClass>();
}

friend_test.cpp:15: error: `void A::func()' should have been declared inside `A'

I suspect this is the same bug ?




-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gianni at mariani dot ws


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



More information about the Gcc-bugs mailing list