Skip to content
Commit fcd9fa41 authored by Yevgeny Rouban's avatar Yevgeny Rouban
Browse files

[Support] Try 2: Reset option to its default if its Default field is undefined

opt::setDefaultImpl() is changed to set the option value to the option
type's default if the Default field is not set. This results in option
value reset by Option::reset() or ResetAllOptionOccurrences() even if
the cl::init() is not specified.

Example:
  StackOption<std::string> Str("str"); // No cl::init().
  Str = "some value";
  cl::ResetAllOptionOccurrences();
  EXPECT_EQ("", Str); // The Str is reset.

Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D115433
parent 43f208e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment