You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// RUN: not %clang_cc1 -std=c++17 %s -emit-llvm-only -fcxx-exceptions
4
3
5
4
structS { int a, b, c; };
@@ -31,7 +30,7 @@ namespace ForRangeDecl {
31
30
namespaceOtherDecl {
32
31
// A parameter-declaration is not a simple-declaration.
33
32
// This parses as an array declaration.
34
-
voidf(auto [a, b, c]); //cxx17-error {{'auto' not allowed in function prototype}} expected-error {{'a'}}
33
+
voidf(auto [a, b, c]); //expected-error {{'auto' not allowed in function prototype}} expected-error {{'a'}}
35
34
36
35
voidg() {
37
36
// A condition is allowed as a Clang extension.
@@ -58,7 +57,7 @@ namespace OtherDecl {
58
57
namespaceGoodSpecifiers {
59
58
voidf() {
60
59
int n[1];
61
-
constvolatileauto &[a] = n;// cxx2b-warning {{volatile qualifier in structured binding declaration is deprecated}}
60
+
constvolatileauto &[a] = n;
62
61
}
63
62
}
64
63
@@ -68,8 +67,8 @@ namespace BadSpecifiers {
68
67
structS { int n; } s;
69
68
voidf() {
70
69
// storage-class-specifiers
71
-
staticauto &[a] = n; //cxx17-warning {{declared 'static' is a C++20 extension}}
72
-
thread_localauto &[b] = n; //cxx17-warning {{declared 'thread_local' is a C++20 extension}}
70
+
staticauto &[a] = n; //expected-warning {{declared 'static' is a C++20 extension}}
71
+
thread_localauto &[b] = n; //expected-warning {{declared 'thread_local' is a C++20 extension}}
73
72
externauto &[c] = n; // expected-error {{cannot be declared 'extern'}} expected-error {{declaration of block scope identifier with linkage cannot have an initializer}}
74
73
structS {
75
74
mutableauto &[d] = n; // expected-error {{not permitted in this context}}
@@ -86,19 +85,16 @@ namespace BadSpecifiers {
86
85
}
87
86
88
87
staticconstexprinlinethread_localauto &[j1] = n; // expected-error {{cannot be declared with 'constexpr inline' specifiers}}
89
-
staticthread_localauto &[j2] = n; //cxx17-warning {{declared with 'static thread_local' specifiers is a C++20 extension}}
88
+
staticthread_localauto &[j2] = n; //expected-warning {{declared with 'static thread_local' specifiers is a C++20 extension}}
90
89
91
90
inlineauto &[k] = n; // expected-error {{cannot be declared 'inline'}}
92
91
93
92
constint K = 5;
94
-
auto ([c]) = s; // expected-error {{decomposition declaration cannot be declared with parentheses}}
95
93
voidg() {
96
94
// defining-type-specifiers other than cv-qualifiers and 'auto'
97
95
S [a] = s; // expected-error {{cannot be declared with type 'S'}}
98
96
decltype(auto) [b] = s; // expected-error {{cannot be declared with type 'decltype(auto)'}}
99
-
auto ([c2]) = s; // cxx17-error {{decomposition declaration cannot be declared with parenthese}} \
100
-
// cxx2b-error {{use of undeclared identifier 'c2'}} \
101
-
// cxx2b-error {{expected body of lambda expression}} \
97
+
auto ([c]) = s; // expected-error {{cannot be declared with parentheses}}
0 commit comments