[Bug c++/40261] New: confusing diagnostic on ill-formed template definition

msebor at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue May 26 17:48:00 GMT 2009


The diagnostic issued for the ill-formed definition of B<T>::foo() below is
quite confusing. EDG eccp issues a better message: template argument list
must match the parameter list.

$ cat z.cpp && gcc -c z.cpp
template <class> struct A { };
template <class T, class U = A<T> > struct B: U { void foo (); };

template <class T> void B<T>::foo () { }

int main ()
{
    B<int> b;
}
z.cpp:4: error: invalid use of incomplete type ‘struct B<T, A<T> >’
z.cpp:2: error: declaration of ‘struct B<T, A<T> >’


-- 
           Summary: confusing diagnostic on ill-formed template definition
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: msebor at gmail dot com


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



More information about the Gcc-bugs mailing list