File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -1459,20 +1459,16 @@ class opt
14591459 }
14601460 }
14611461
1462- template <class T , class = std::enable_if_t <std::is_assignable_v<T &, T>>>
1463- void setDefaultImpl () {
1464- const OptionValue<DataType> &V = this ->getDefault ();
1465- if (V.hasValue ())
1466- this ->setValue (V.getValue ());
1467- else
1468- this ->setValue (T ());
1462+ void setDefault () override {
1463+ if constexpr (std::is_assignable_v<DataType &, DataType>) {
1464+ const OptionValue<DataType> &V = this ->getDefault ();
1465+ if (V.hasValue ())
1466+ this ->setValue (V.getValue ());
1467+ else
1468+ this ->setValue (DataType ());
1469+ }
14691470 }
14701471
1471- template <class T , class = std::enable_if_t <!std::is_assignable_v<T &, T>>>
1472- void setDefaultImpl (...) {}
1473-
1474- void setDefault () override { setDefaultImpl<DataType>(); }
1475-
14761472 void done () {
14771473 addArgument ();
14781474 Parser.initialize ();
You can’t perform that action at this time.
0 commit comments