This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/39478] New: please improve recursive template instantiation diagnostics


When a template is instantiated and the instantiation requires access to the
instantiated template, the error message is not as helpful as it could/should
be. Consider:

frey@viasko:~/work/test/recursive_instantiation$ cat t.cc
template< typename T >
struct foo
{
  typename T::type dummy();
};

template< typename T >
struct bar
{
  typedef void type;
  foo< bar > p;
};

foo< bar< int > > x;
frey@viasko:~/work/test/recursive_instantiation$ g++ t.cc
t.cc: In instantiation of 'bar<int>':
t.cc:4:   instantiated from 'foo<bar<int> >'
t.cc:14:   instantiated from here
t.cc:11: error: 'bar<T>::p' has incomplete type
t.cc:3: error: declaration of 'struct foo<bar<int> >'
frey@viasko:~/work/test/recursive_instantiation$ 

The problem is t.cc:11: error: 'bar<T>::p' has incomplete type - at that point
I hoped for a more helpful message.


-- 
           Summary: please improve recursive template instantiation
                    diagnostics
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: d dot frey at gmx dot de


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]