This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49453] New: Accepts invalid syntax for partial specialization of class template where the specialization is a class template
- From: "Nimantha.Siriwardana at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jun 2011 13:17:16 +0000
- Subject: [Bug c++/49453] New: Accepts invalid syntax for partial specialization of class template where the specialization is a class template
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49453
Summary: Accepts invalid syntax for partial specialization of
class template where the specialization is a class
template
Product: gcc
Version: 4.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: Nimantha.Siriwardana@googlemail.com
Example:
#include <iostream>
template <typename F>
struct foo{
typedef F value_type;
};
template <typename G>
struct bar{};
//template<> <- works if commented out or not
template <typename F>
struct bar<foo<F> >
{
typename foo<F>::value_type val;
};
int main(void)
{
typedef foo<int> F;
typedef bar<F> B;
B b;
b.val = 10;
std::cout << b.val << std::endl;
return 0;
};
I have been led to believe that this is incorrect behaviour, have tested on
4.4.4 and 4.5.1 and this appears to be the same.