From: Chris Lattner Date: Wed, 25 Mar 2009 21:01:40 +0000 (+0000) Subject: remove some dead code. ArgTokens can never be empty, because it is always X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03162d6d2aef5667816ce19788b6a752299bea43;p=clang remove some dead code. ArgTokens can never be empty, because it is always terminated with an EOF token. The condition it is trying to check for is handled by this code above. // Empty arguments are standard in C99 and supported as an extension in // other modes. if (ArgTokens.empty() && !Features.C99) Diag(Tok, diag::ext_empty_fnmacro_arg); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67705 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 712918b7c3..6ec306196d 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -390,15 +390,6 @@ MacroArgs *Preprocessor::ReadFunctionLikeMacroArgs(Token &MacroName, // #define A(x, foo...) blah(a, ## foo) // #define A(x, ...) blah(a, ## __VA_ARGS__) isVarargsElided = MI->getNumArgs() > 1; - } else if (MI->getNumArgs() == 1) { - // #define A(x) - // A() - // is ok because it is an empty argument. - - // Empty arguments are standard in C99 and supported as an extension in - // other modes. - if (ArgTokens.empty() && !Features.C99) - Diag(Tok, diag::ext_empty_fnmacro_arg); } else { // Otherwise, emit the error. Diag(Tok, diag::err_too_few_args_in_macro_invoc);