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++/16964] New: [3.4/3.5 regression] ICE in cp_parser_class_specifier when specializing after use


This little piece of code, extracted from PR 16934, ICEs the 
compiler (note that the code is, of course, invalid): 
----------------- 
struct X  {  
    template<typename> struct Y { typedef int type; };  
    typedef Y<int>::type type;  
};  
  
template<> struct X::Y<int> { typedef int type; };  
----------------- 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c a.cc 
a.cc:6: error: specialization of `X::Y<int>' after instantiation 
a.cc:6: error: redefinition of `struct X::Y<int>' 
a.cc:2: error: previous definition of `struct X::Y<int>' 
a.cc:6: internal compiler error: tree check: expected class 't', have 
'x' (error_mark) in cp_parser_class_specifier, at cp/parser.c:12371 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
This ICE is a regression in 3.4 and mainline against previous versions. 
 
W.

-- 
           Summary: [3.4/3.5 regression] ICE in cp_parser_class_specifier
                    when specializing after use
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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