Fails on:
  gcc (GCC) 3.3.4 (Mandrakelinux 10.1 3.3.4-2mdk)
  Linux 2.6.8.1-12mdk #1 i686 Athlon XP GNU/Linux

and

  g++ (GCC) 3.4.0
  SunOS 5.9 Generic_112233-12 sun4u sparc SUNW,UltraAX-i2

The following fails to compile:

template<class T>
class Foo {
    // The "friend" declaration below causes fialure with
    // error: using template type parameter `T' after `class'
    friend class T;
};

class Bar {
};

int
main(int, char**)
{
    Foo<Bar> foo;
    return 0;
}


-- 
           Summary: Can't use template argument as friend
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mikel at att dot net


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

Reply via email to