File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -1459,18 +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+ template <class T > void setDefaultImpl () {
1463+ if constexpr (std::is_assignable_v<T &, T>) {
1464+ const OptionValue<DataType> &V = this ->getDefault ();
1465+ if (V.hasValue ())
1466+ this ->setValue (V.getValue ());
1467+ else
1468+ this ->setValue (T ());
1469+ }
14691470 }
14701471
1471- template <class T , class = std::enable_if_t <!std::is_assignable_v<T &, T>>>
1472- void setDefaultImpl (...) {}
1473-
14741472 void setDefault () override { setDefaultImpl<DataType>(); }
14751473
14761474 void done () {
You can’t perform that action at this time.
0 commit comments