This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52625] Incorrect specialization semantics of friend class template declaration
- From: "tsoae at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Mar 2012 07:34:03 +0000
- Subject: [Bug c++/52625] Incorrect specialization semantics of friend class template declaration
- Auto-submitted: auto-generated
- References: <bug-52625-4@http.gcc.gnu.org/bugzilla/>
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() {}