[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Parser / cxx2b-init-statement.cpp
blob8f99b46edeb65079c1506ed0aa8abc5efcab175a
1 // RUN: %clang_cc1 -fsyntax-only -verify=expected -std=c++2b -Wall %s
2 // RUN: %clang_cc1 -fsyntax-only -verify=expected,expected-cxx20 -std=c++20 -Wall %s
4 namespace ns {
5 int i;
6 enum class e {};
8 void f() {
10 for (using foo = int;true;); //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}}
12 switch(using foo = int; 0) { //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}}
13 case 0: break;
16 if(using foo = int; false) {} //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}}
19 if (using enum ns::e; false){} // expected-error {{expected '='}}
21 for (using ns::i; true;); // expected-error {{expected '='}}
23 if (using ns::i; false){} // expected-error {{expected '='}}
25 switch(using ns::i; 0) { // expected-error {{expected '='}}
26 case 0: break;