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

             Bug #: 53099
           Summary: Internal compiler error on short testcase
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: rippe...@gmail.com


When a file containing only "template<A> a() { class a <" is run it produces:

bad21.cpp:1:10: error: ‘A’ has not been declared
 template<A> a() { class a <
          ^
bad21.cpp:1:15: error: ISO C++ forbids declaration of ‘a’ with no type
[-fpermissive]
 template<A> a() { class a <
               ^
bad21.cpp: In function ‘int a()’:
bad21.cpp:1:25: error: parse error in template argument list
 template<A> a() { class a <
                         ^
bad21.cpp:1:25: error: using typedef-name ‘a<<expression error> >’ after
‘class’
 template<A> a() { class a <
                         ^
bad21.cpp:1:25: internal compiler error: tree check: expected tree that
contains ‘decl minimal’ structure, have ‘template_id_expr’ in
check_elaborated_type_specifier, at cp/decl.c:11513
 template<A> a() { class a <
                         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This is with SVN version 186738 on i686 GNU/Linux, with no configure options.
No special command line options are required - this is triggered by "g++
bad.cpp".  

The code snippet is obviously invalid C++.  The snippet was arrived at by
taking a program that was valid C++ but also triggered internal compiler
errors, and reducing its size as much as possible without regard for validity.

Reply via email to