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
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/paren-list-agg-init.cpp
+20-1
Original file line number
Diff line number
Diff line change
@@ -314,8 +314,8 @@ namespace GH63903 {
314
314
// expected-error {{constexpr variable 's' must be initialized by a constant expression}}
315
315
}
316
316
317
-
318
317
namespacegh62863 {
318
+
319
319
int (&&arr)[] = static_cast<int[]>(42);
320
320
// beforecxx20-warning@-1 {{aggregate initialization of type 'int[1]' from a parenthesized list of values is a C++20 extension}}
321
321
int (&&arr1)[1] = static_cast<int[]>(42);
@@ -333,4 +333,23 @@ int (&&arr6)[2] = (int[])(42); // expected-error {{reference to type 'int[2]' co
333
333
// beforecxx20-warning@-1 {{aggregate initialization of type 'int[1]' from a parenthesized list of values is a C++20 extension}}
334
334
int (&&arr7)[3] = (int[3])(42);
335
335
// beforecxx20-warning@-1 {{aggregate initialization of type 'int[3]' from a parenthesized list of values is a C++20 extension}}
336
+
337
+
}
338
+
339
+
namespaceGH92284 {
340
+
341
+
using T = int[1]; T x(42);
342
+
// beforecxx20-warning@-1 {{aggregate initialization of type 'T' (aka 'int[1]') from a parenthesized list of values is a C++20 extension}}
343
+
using Ta = int[2]; Ta a(42);
344
+
// beforecxx20-warning@-1 {{aggregate initialization of type 'Ta' (aka 'int[2]') from a parenthesized list of values is a C++20 extension}}
345
+
using Tb = int[2]; Tb b(42,43);
346
+
// beforecxx20-warning@-1 {{aggregate initialization of type 'Tb' (aka 'int[2]') from a parenthesized list of values is a C++20 extension}}
347
+
using Tc = int[]; Tc c(42);
348
+
// beforecxx20-warning@-1 {{aggregate initialization of type 'int[1]' from a parenthesized list of values is a C++20 extension}}
349
+
using Td = int[]; Td d(42,43);
350
+
// beforecxx20-warning@-1 {{aggregate initialization of type 'int[2]' from a parenthesized list of values is a C++20 extension}}
351
+
template<typename T, int Sz> using ThroughAlias = T[Sz];
352
+
ThroughAlias<int, 1> e(42);
353
+
// beforecxx20-warning@-1 {{aggregate initialization of type 'ThroughAlias<int, 1>' (aka 'int[1]') from a parenthesized list of values is a C++20 extension}}
0 commit comments