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++/52625] Incorrect specialization semantics of friend class template declaration


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

Nikolka <tsoae at mail dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tsoae at mail dot ru

--- Comment #1 from Nikolka <tsoae at mail dot ru> 2012-03-20 07:34:03 UTC ---
G++ issues the same diagnostic message for the following example:

    template<class>
        class base {};

    class derived : public base<derived>
    {
        // error: specialization of 'base<derived>' after instantiation
        template<class>
            friend class base<derived>;
    };

It seems that in the original example g++ incorrectly treats the
injected-class-name ::base<derived>::base as template specialization
base<derived>, while according to 14.6.1/1 it shall be refer to class template
base. Note that g++ does not issue an error in the following case:

    template<class>
        class base {};

    class derived : public base<derived>
    {
        template<class>
            friend class ::base;
    };

    int main() {}


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