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++/27668] New: [4.0/4.1/4.2 regression] ICE with invalid template parameter


The following invalid code snippet triggers an ICE since GCC 3.4.0:

==================================================
template<typename class T, T = T()> struct A {};

template<int> void foo(A<int>);
==================================================

bug.cc:1: error: expected nested-name-specifier before 'class'
bug.cc:1: error: two or more data types in declaration of 'parameter'
bug.cc:1: error: 'struct T' is not a valid type for a template constant
parameter
bug.cc:3: error: type/value mismatch at argument 1 in template parameter list
for 'template<int <anonymous>, void <anonymous> > struct A'
bug.cc:3: error:   expected a constant of type 'int', got 'int'
bug.cc:3: internal compiler error: in value_dependent_expression_p, at
cp/pt.c:12489
Please submit a full bug report, [etc.]


-- 
           Summary: [4.0/4.1/4.2 regression] ICE with invalid template
                    parameter
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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