Files
clang-p2996/clang/test/SemaTemplate/deduction-crash.cpp
Douglas Gregor 5f0e252f63 When there are extra or missing template parameter lists in a template
definition, we're likely going to end up breaking the invariants of
the template system, e.g., that the depths of template parameter lists
match up with the nesting template of the template. So, make sure we
mark such ill-formed declarations as invalid or don't even build them
at all.

llvm-svn: 108372
2010-07-14 23:14:12 +00:00

60 lines
894 B
C++

// RUN: %clang_cc1 -fsyntax-only %s 2>&1| FileCheck %s
// PR7511
// Note that the error count below doesn't matter. We just want to
// make sure that the parser doesn't crash.
// CHECK: 16 errors
template<a>
struct int_;
template<a>
template<int,typename T1,typename>
struct ac
{
typedef T1 ae
};
template<class>struct aaa
{
typedef ac<1,int,int>::ae ae
};
template<class>
struct state_machine
{
typedef aaa<int>::ae aaa;
int start()
{
ant(0);
}
template<class>
struct region_processing_helper
{
template<class,int=0>
struct In;
template<int my>
struct In<a::int_<aaa::a>,my>;
template<class Event>
int process(Event)
{
In<a::int_<0> > a;
}
}
template<class Event>
int ant(Event)
{
region_processing_helper<int>* helper;
helper->process(0)
}
};
int a()
{
state_machine<int> p;
p.ant(0);
}