c++/10398: [3.4 regression] ICE with missing typename keyword

Christian Ehrhardt ehrhardt@mathematik.uni-ulm.de
Mon Apr 14 11:56:00 GMT 2003


>Number:         10398
>Category:       c++
>Synopsis:       [3.4 regression] ICE with missing typename keyword
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 14 11:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christian Ehrhardt
>Release:        gcc-3.4
>Organization:
>Environment:
SunOS theseus 5.9 Generic_112233-03 sun4u sparc SUNW,Ultra-4
>Description:
This is what remains from PR 10394 after Giovanni's analysis.
I'll close 10394 once this has a PR number.

The following piece of code gives an ICE with 3.4.

 template <class T>
 struct A
 { 
   template <class U>
   class B {};
 };
  
 template <class V>
 struct C
 { 
   C()
   {
       A<typename V::X>::template B<int> k;
   }
 };
 
 struct E
 {
   typedef int X;
 };
 
 template struct C<E>;
 
 int main()
 {}

theseus$ ~/gcc-3.4-cvs/build/gcc/cc1plus  10394.cc -quiet
10394.cc: In constructor `C<V>::C()':
10394.cc:13: error: expected `;'
10394.cc: In constructor `C<V>::C() [with V = E]':
10394.cc:22:   instantiated from here
10394.cc:13: internal compiler error: in resolve_offset_ref, at cp/init.c:1841
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

  regards  Christian
>How-To-Repeat:
.
>Fix:
Add typename before the definition of k.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list