31 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s2 3// Ensure that we don't crash if errors are suppressed by an error limit.4// RUN: not %clang_cc1 -fsyntax-only -std=c++17 -ferror-limit=1 %s5 6error e; // expected-error {{unknown type name}}7 8template <typename>9class Bar {10 Bar<int> *variables_to_modify;11 foo() { // expected-error {{a type specifier is required for all declarations}}12 for (auto *c : *variables_to_modify)13 delete c;14 }15};16 17void foo() {18 int a;19 struct X; // expected-note {{forward declaration}}20 for (X x // expected-error {{incomplete type}}21 : a) { // expected-error {{range expression of type 'int'}}22 constexpr int n = sizeof(x);23 }24 25 struct S { int x, y; };26 for (S [x, y] // expected-error {{must be 'auto'}}27 : a) { // expected-error {{range expression}}28 typename decltype(x)::a b;29 }30}31