mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 02:06:04 +00:00

Instead of bailing out of parsing when we encounter an invalid template-name or template arguments in a template-id, produce an annotation token describing the invalid construct. This avoids duplicate errors and generally allows us to recover better. In principle we should be able to extend this to store some kinds of invalid template-id in the AST for tooling use, but that isn't handled as part of this change.
12 lines
330 B
C++
12 lines
330 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
template <class T>
|
|
struct X : public Foo<Bar { // expected-error {{unknown template name 'Foo'}} expected-error {{use of undeclared identifier 'Bar'}}
|
|
X();
|
|
}; // expected-error {{expected '>'}} expected-error {{expected '{' after base class list}}
|
|
|
|
|
|
template <class T>
|
|
X<T>::X() {
|
|
}
|