mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 14:36:07 +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.
17 lines
489 B
C++
17 lines
489 B
C++
// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
|
|
|
|
// CHECK: error: expected expression
|
|
// CHECK: error: expected '>'
|
|
// CHECK: error: expected member name or ';' after declaration specifiers
|
|
// CHECK: error: expected '}'
|
|
// CHECK: note: to match this '{'
|
|
// CHECK: error: expected ';' after class
|
|
// CHECK: 5 errors generated.
|
|
|
|
// Do not add anything to the end of this file. This requires the whitespace
|
|
// plus EOF after the '<' token.
|
|
|
|
template <typename T>
|
|
class a {
|
|
a<
|