From: Mehdi Amini Date: Sat, 8 Oct 2016 19:41:06 +0000 (+0000) Subject: Turn cl::values() (for enum) from a vararg function to using C++ variadic template X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5f86e2485e267ae93fa7e5139fc1c8c3c22335e;p=clang Turn cl::values() (for enum) from a vararg function to using C++ variadic template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283671 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/c-index-test/core_main.cpp b/tools/c-index-test/core_main.cpp index e64dae726f..7b7acf0770 100644 --- a/tools/c-index-test/core_main.cpp +++ b/tools/c-index-test/core_main.cpp @@ -41,8 +41,7 @@ static cl::opt Action(cl::desc("Action:"), cl::init(ActionType::None), cl::values( clEnumValN(ActionType::PrintSourceSymbols, - "print-source-symbols", "Print symbols from source"), - clEnumValEnd), + "print-source-symbols", "Print symbols from source")), cl::cat(IndexTestCoreCategory)); static cl::extrahelp MoreHelp( diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp index 9aa0c495ce..6fb5b00c4b 100644 --- a/utils/TableGen/TableGen.cpp +++ b/utils/TableGen/TableGen.cpp @@ -135,8 +135,7 @@ cl::opt Action( clEnumValN(GenAttrDocs, "gen-attr-docs", "Generate attribute documentation"), clEnumValN(GenDiagDocs, "gen-diag-docs", - "Generate attribute documentation"), - clEnumValEnd)); + "Generate attribute documentation"))); cl::opt ClangComponent("clang-component",