diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index 3dbc21b2d8c49..29e2dca04c900 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -1436,8 +1436,6 @@ class opt : public Option, const OptionValue &V = this->getDefault(); if (V.hasValue()) this->setValue(V.getValue()); - else - this->setValue(T()); } template Option("option"); - StackOption Str("str"); enum Vals { ValA, ValB, ValC }; StackOption> Bits( cl::values(clEnumValN(ValA, "enableA", "Enable A"), @@ -1946,16 +1945,15 @@ TEST(CommandLineTest, ResetAllOptionOccurrences) { StackOption Input(cl::Positional); StackOption> ExtraArgs(cl::ConsumeAfter); - const char *Args[] = {"prog", "-option", "-str=STR", "-enableA", - "-enableC", "-unknown", "input", "-arg"}; + const char *Args[] = {"prog", "-option", "-enableA", "-enableC", + "-unknown", "input", "-arg"}; std::string Errs; raw_string_ostream OS(Errs); - EXPECT_TRUE(cl::ParseCommandLineOptions(8, Args, StringRef(), &OS)); + EXPECT_TRUE(cl::ParseCommandLineOptions(7, Args, StringRef(), &OS)); EXPECT_TRUE(OS.str().empty()); EXPECT_TRUE(Option); - EXPECT_EQ("STR", Str); EXPECT_EQ((1u << ValA) | (1u << ValC), Bits.getBits()); EXPECT_EQ(1u, Sink.size()); EXPECT_EQ("-unknown", Sink[0]); @@ -1965,7 +1963,6 @@ TEST(CommandLineTest, ResetAllOptionOccurrences) { cl::ResetAllOptionOccurrences(); EXPECT_FALSE(Option); - EXPECT_EQ("", Str); EXPECT_EQ(0u, Bits.getBits()); EXPECT_EQ(0u, Sink.size()); EXPECT_EQ(0, Input.getNumOccurrences());