From a8b32dec677b28abe348984945e69c4d7e63125c Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Sat, 7 Apr 2018 09:46:00 +0000 Subject: [PATCH] Fix stack-use-after-scope in test previously hidden by -fmerge-all-constants llvm-svn: 329489 --- llvm/unittests/Support/CommandLineTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index 328dfa39ef7d..8657504e5074 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -96,9 +96,9 @@ cl::OptionCategory TestCategory("Test Options", "Description"); TEST(CommandLineTest, ModifyExisitingOption) { StackOption 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 &Map = cl::getRegisteredOptions(*cl::TopLevelSubCommand);