brintos

brintos / llvm-project-archived public Read only

0
0
Text · 947 B · b5c05ae Raw
27 lines · cpp
1// RUN: %clang_cc1 -verify %s2// RUN: %clang_cc1 -verify %s -std=c++983// RUN: %clang_cc1 -verify %s -std=c++114// RUN: %clang_cc1 -verify %s -std=c++1z5 6// PR259467// We had an off-by-one error in an assertion when annotating A<int> below.  Our8// error recovery checks if A<int> is a constructor declarator, and opens a9// TentativeParsingAction. Then we attempt to annotate the token at the exact10// position that we want to possibly backtrack to, and this used to crash.11 12template <typename T> class A {};13 14// expected-error@+1 {{expected '{' after base class list}}15template <typename T> class B : T // not ',' or '{'16#if __cplusplus < 201103L17// expected-error@+8 {{expected ';' after top level declarator}}18#endif19#if __cplusplus <= 201402L20// expected-error@+5 {{a type specifier is required for all declarations}}21#else22// expected-error@+3 {{expected unqualified-id}}23#endif24// expected-error@+1 {{expected ';' after class}}25A<int> {26};27