Skip to content

Commit 9bbce08

Browse files
committed
update tests
1 parent a6b55ed commit 9bbce08

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

clang/test/Parser/c2x-auto.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ auto basic_usage(auto auto) { // c23-error {{'auto' not allowed in function pr
6262

6363
int auto_cxx_decl = auto(0); // expected-error {{expected expression}}
6464

65-
constexpr auto int x = 0; // c23-error {{cannot combine with previous 'auto' declaration specifier}} \
66-
c17-error {{use of undeclared identifier 'constexpr'}}
67-
68-
constexpr int auto y = 0; // c23-error {{cannot combine with previous 'int' declaration specifier}} \
69-
c17-error {{use of undeclared identifier 'constexpr'}}
70-
7165
return c;
7266
}
7367

@@ -136,3 +130,30 @@ void atomic(void) {
136130
void attributes(void) {
137131
auto ident [[clang::annotate("this works")]] = 12; // c17-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}}
138132
}
133+
134+
/** GH163090 */
135+
constexpr auto int a1 = 0; // c23-error {{illegal storage class on file-scoped variable}} \
136+
c23-error {{cannot combine with previous 'auto' declaration specifier}} \
137+
c17-error {{illegal storage class on file-scoped variable}} \
138+
c17-error {{unknown type name 'constexpr'}}
139+
140+
constexpr int auto a2 = 0; // c23-error {{cannot combine with previous 'int' declaration specifier}} \
141+
c17-error {{illegal storage class on file-scoped variable}} \
142+
c17-error {{unknown type name 'constexpr'}}
143+
144+
auto int b1 = 0; // c23-error {{illegal storage class on file-scoped variable}} \
145+
c17-error {{illegal storage class on file-scoped variable}}
146+
147+
int auto b2 = 0; // c23-error {{cannot combine with previous 'int' declaration specifier}} \
148+
c17-error {{illegal storage class on file-scoped variable}}
149+
150+
void f() {
151+
constexpr auto int c1 = 0; // c23-error {{cannot combine with previous 'auto' declaration specifier}} \
152+
c17-error {{use of undeclared identifier 'constexpr'}}
153+
154+
constexpr int auto c2 = 0; // c23-error {{cannot combine with previous 'int' declaration specifier}} \
155+
c17-error {{use of undeclared identifier 'constexpr'}}
156+
157+
auto int d1 = 0;
158+
int auto d2 = 0; // c23-error {{cannot combine with previous 'int' declaration specifier}}
159+
}

0 commit comments

Comments
 (0)