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: unassig...@gcc.gnu.org
        ReportedBy: nimantha.siriward...@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.

Reply via email to