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/C/C2y/n3409.c
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,18 @@ void foo() {
19
19
(void)(void)1;
20
20
// FIXME: same with this.
21
21
x;
22
-
_Generic(x, void: 1); /* pre-c2y-warning {{use of an incomplete type in a '_Generic' association is incompatible with C standards before C2y; 'void' is an incomplete type}}
23
-
ext-warning {{ISO C requires a complete type in a '_Generic' association; 'void' is an incomplete type}}
22
+
_Generic(x, void: 1); /* pre-c2y-warning {{use of incomplete type 'void' in a '_Generic' association is incompatible with C standards before C2y}}
23
+
ext-warning {{incomplete type 'void' in a '_Generic' associationis a C2y extension}}
24
24
*/
25
-
_Generic(x, typeof(x): 1); /* pre-c2y-warning {{use of an incomplete type in a '_Generic' association is incompatible with C standards before C2y; 'typeof (x)' (aka 'void') is an incomplete type}}
26
-
ext-warning {{ISO C requires a complete type in a '_Generic' association; 'typeof (x)' (aka 'void') is an incomplete type}}
25
+
_Generic(x, typeof(x): 1); /* pre-c2y-warning {{use of incomplete type 'typeof (x)' (aka 'void') in a '_Generic' association is incompatible with C standards before C2y}}
26
+
ext-warning {{incomplete type 'typeof (x)' (aka 'void') in a '_Generic' association is a C2y extension}}
27
27
*/
28
28
(void)_Generic(void, default : 1); /* pre-c2y-warning {{passing a type argument as the first operand to '_Generic' is incompatible with C standards before C2y}}
29
29
ext-warning {{passing a type argument as the first operand to '_Generic' is a C2y extension}}
30
30
*/
31
-
}
32
31
32
+
// This is not sufficiently important of an extension to warrant a "not
33
+
// compatible with standards before C2y" warning, but it is an extension in
34
+
// C23 and earlier.
35
+
returnx; // ext-warning {{void function 'foo' should not return void expression}}
0 commit comments