[llvm] r329489 - Fix stack-use-after-scope in test previously hidden by -fmerge-all-constants

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 7 02:46:00 PDT 2018


Author: vitalybuka
Date: Sat Apr  7 02:46:00 2018
New Revision: 329489

URL: http://llvm.org/viewvc/llvm-project?rev=329489&view=rev
Log:
Fix stack-use-after-scope in test previously hidden by -fmerge-all-constants

Modified:
    llvm/trunk/unittests/Support/CommandLineTest.cpp

Modified: llvm/trunk/unittests/Support/CommandLineTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CommandLineTest.cpp?rev=329489&r1=329488&r2=329489&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/CommandLineTest.cpp (original)
+++ llvm/trunk/unittests/Support/CommandLineTest.cpp Sat Apr  7 02:46:00 2018
@@ -96,9 +96,9 @@ cl::OptionCategory TestCategory("Test Op
 TEST(CommandLineTest, ModifyExisitingOption) {
   StackOption<int> TestOption("test-option", cl::desc("old description"));
 
-  const char Description[] = "New description";
-  const char ArgString[] = "new-test-option";
-  const char ValueString[] = "Integer";
+  static const char Description[] = "New description";
+  static const char ArgString[] = "new-test-option";
+  static const char ValueString[] = "Integer";
 
   StringMap<cl::Option *> &Map =
       cl::getRegisteredOptions(*cl::TopLevelSubCommand);




More information about the llvm-commits mailing list