[Bug c++/47343] New: incorrect location for declaration of class template partial specialization

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 18 13:14:00 GMT 2011


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

           Summary: incorrect location for declaration of class template
                    partial specialization
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


template<class T>
  struct X : T
  {
    void f();
  };

template<class T>
  inline void
  X<T>::f()
  { }

template<typename T>
  struct Y
  { };

template<class T>
  struct X< Y<T> >;  // here

template<class T>
  inline void
  X< Y<T> >::f()    // xxx
  { }

ps2.cc:21:16: error: invalid use of incomplete type 'struct X<Y<T> >'
ps2.cc:2:10: error: declaration of 'struct X<Y<T> >'

The declaration of the partial specialization is on line 17 not line 2

(related to PR 47342)



More information about the Gcc-bugs mailing list