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
Define a diagnostic group for missing variadic macro arguments (llvm#116855)
Make the new diagnostic group a subgroup of the following diagnostic
groups:
-Wpre-c23-compat
-Wgnu-zero-variadic-macro-arguments
-Wc++20-extensions
-Wc23-extensions
This change is needed as 5231005 made
it impossible to use -Wno-gnu-zero-variadic-macro-argumentsis to silence
the warning.
rdar://139234984
#definezero_dot(...) 0 /* expected-warning {{variadic macros are a C99 feature}} */
8
-
#defineone_dot(x, ...) 0 /* expected-warning {{variadic macros are a C99 feature}} expected-note 2{{macro 'one_dot' defined here}} */
10
+
#defineone_dot(x, ...) 0 /* expected-warning {{variadic macros are a C99 feature}} */
11
+
12
+
#ifndefOMIT_VARIADIC_MACRO_ARGS
13
+
/* expected-note@-3 2{{macro 'one_dot' defined here}} */
14
+
#endif
9
15
10
16
zero()
11
17
zero(1); /* expected-error {{too many arguments provided to function-like macro invocation}} */
@@ -37,16 +43,24 @@ e(x)
37
43
e()
38
44
39
45
zero_dot()
40
-
one_dot(x) /* empty ... argument: expected-warning {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}} */
41
-
one_dot() /* empty first argument, elided ...: expected-warning {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}} */
46
+
one_dot(x) /* empty ... argument */
47
+
one_dot() /* empty first argument, elided ... */
42
48
49
+
#ifndefOMIT_VARIADIC_MACRO_ARGS
50
+
/* expected-warning@-4 {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}} */
51
+
/* expected-warning@-4 {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}} */
52
+
#endif
43
53
44
54
/* Crash with function-like macro test at end of directive. */
45
55
#defineE() (i==0)
46
56
#ifE
47
57
#endif
48
58
49
-
50
59
#defineNSAssert(condition, desc, ...) /* expected-warning {{variadic macros are a C99 feature}} */ \
51
-
SomeComplicatedStuff((desc), ##__VA_ARGS__) /* expected-warning {{token pasting of ',' and __VA_ARGS__ is a GNU extension}} */
60
+
SomeComplicatedStuff((desc), ##__VA_ARGS__)
61
+
62
+
#ifndefVARIADIC_MACRO_ARGS_REMOVE_COMMA
63
+
/* expected-warning@-3 {{token pasting of ',' and __VA_ARGS__ is a GNU extension}} */
0 commit comments