return;
}
+ // If this is a definition of a variadic C99 function-like macro, not using
+ // the GNU named varargs extension, enabled __VA_ARGS__.
+
+ // "Poison" __VA_ARGS__, which can only appear in the expansion of a macro.
+ // This gets unpoisoned where it is allowed.
+ assert(Ident__VA_ARGS__->isPoisoned() && "__VA_ARGS__ should be poisoned!");
+ if (MI->isC99Varargs())
+ Ident__VA_ARGS__->setIsPoisoned(false);
+
// Read the first token after the arg list for down below.
LexUnexpandedToken(Tok);
} else if (Features.C99) {
Diag(Tok, diag::warn_missing_whitespace_after_macro_name);
}
- // If this is a definition of a variadic C99 function-like macro, not using
- // the GNU named varargs extension, enabled __VA_ARGS__.
-
- // "Poison" __VA_ARGS__, which can only appear in the expansion of a macro.
- // This gets unpoisoned where it is allowed.
- assert(Ident__VA_ARGS__->isPoisoned() && "__VA_ARGS__ should be poisoned!");
- if (MI->isC99Varargs())
- Ident__VA_ARGS__->setIsPoisoned(false);
-
// Read the rest of the macro body.
if (MI->isObjectLike()) {
// Object-like macros are very simple, just read their body.
expected-error {{too many arguments provided to function-like macro invocation}} */
)
two(,) /* expected-warning 2 {{empty macro arguments were standardized in C99}} */
+
+
+
+/* PR4006 */
+#define e(...) __VA_ARGS__ /* expected-warning {{variadic macros were introduced in C99}} */
+e(x)