1*ff013b61SCorentin Jabot // RUN: %clang_cc1 -fsyntax-only -verify=expected -std=c++2b -Wall %s
2*ff013b61SCorentin Jabot // RUN: %clang_cc1 -fsyntax-only -verify=expected,expected-cxx20 -std=c++20 -Wall %s
3*ff013b61SCorentin Jabot 
4*ff013b61SCorentin Jabot namespace ns {
5*ff013b61SCorentin Jabot     int i;
6*ff013b61SCorentin Jabot     enum class e {};
7*ff013b61SCorentin Jabot }
f()8*ff013b61SCorentin Jabot void f() {
9*ff013b61SCorentin Jabot 
10*ff013b61SCorentin Jabot     for (using foo = int;true;); //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}}
11*ff013b61SCorentin Jabot 
12*ff013b61SCorentin Jabot     switch(using foo = int; 0) { //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}}
13*ff013b61SCorentin Jabot         case 0: break;
14*ff013b61SCorentin Jabot     }
15*ff013b61SCorentin Jabot 
16*ff013b61SCorentin Jabot     if(using foo = int; false) {} //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}}
17*ff013b61SCorentin Jabot 
18*ff013b61SCorentin Jabot 
19*ff013b61SCorentin Jabot     if (using enum ns::e; false){}  // expected-error {{expected '='}}
20*ff013b61SCorentin Jabot 
21*ff013b61SCorentin Jabot     for (using ns::i; true;);  // expected-error {{expected '='}}
22*ff013b61SCorentin Jabot 
23*ff013b61SCorentin Jabot     if (using ns::i; false){}  // expected-error {{expected '='}}
24*ff013b61SCorentin Jabot 
25*ff013b61SCorentin Jabot     switch(using ns::i; 0) {   // expected-error {{expected '='}}
26*ff013b61SCorentin Jabot         case 0: break;
27*ff013b61SCorentin Jabot     }
28*ff013b61SCorentin Jabot 
29*ff013b61SCorentin Jabot }
30