This patch fixes PR16677. The latter represents the case when due to misprinted character class definition occurs in the scope of template arguments. Base class of this class depends on the template parameter in the same scope and cannot be resolved, it causes crash. Right behavior is to make semantic processing even if the definition is wrong, as the code that emits appropriate message is called after the processing. llvm-svn: 256511
17 lines
583 B
C++
17 lines
583 B
C++
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
|
|
|
|
class Class_With_Destructor {
|
|
~Class_With_Destructor() { }
|
|
};
|
|
|
|
template <class T>
|
|
class Base { };
|
|
|
|
template<class T, // Should be angle bracket instead of comma
|
|
class Derived : public Base<T> { // expected-error{{'Derived' cannot be defined in a type specifier}}
|
|
Class_With_Destructor member;
|
|
}; // expected-error{{a non-type template parameter cannot have type 'class Derived'}}
|
|
// expected-error@-1{{expected ',' or '>' in template-parameter-list}}
|
|
// expected-warning@-2{{declaration does not declare anything}}
|
|
|