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
1459
1459
}
1460
1460
}
1461
1461
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
+ }
1469
1470
}
1470
1471
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
-
1476
1472
void done () {
1477
1473
addArgument ();
1478
1474
Parser.initialize ();
You can’t perform that action at this time.
0 commit comments