Fix clang -Wpotentially-evaluated-expression warning
All threads resolved!
All threads resolved!
With clang something like
std::unique_ptr<SomeBase> object{new SomeDerivation{}};
std::cout << typeid(*object).name() << '\n';
results in a warning like:
warning: expression with side effects will be evaluated despite being used as an operand to 'typeid' [-Wpotentially-evaluated-expression] which is correct.
The fix is to change the code as:
std::unique_ptr<SomeBase> object{new SomeDerivation{}};
auto bare_ptr = object.get();
std::cout << typeid(*bare_ptr).name() << '\n';
i.e. make the evaluation explicit (since it's wanted).
Edited by Marco Clemencic
Merge request reports
Activity
Filter activity
changed milestone to %v32r2
- [2019-09-19 15:30] Validation started with lhcb-gaudi-merge#821
- [2019-09-19 16:44] Validation started with lhcb-dd4hep#322
- [2019-09-19 18:31] Validation started with lhcb-test-throughput2#13
- [2019-09-19 21:17] Validation started with lhcb-test-throughput2#14
- [2019-09-19 23:16] Validation started with lhcb-test-throughput2#15
- [2019-09-20 00:03] Validation started with lhcb-gaudi-head-py3#181
- [2019-09-20 00:04] Validation started with lhcb-lcg-dev4#1036
- [2019-09-20 00:04] Validation started with lhcb-sanitizers#376
- [2019-09-20 00:05] Validation started with lhcb-lcg-dev3#1026
- [2019-09-20 00:05] Validation started with lhcb-dd4hep#323
- [2019-09-20 00:05] Validation started with lhcb-test-throughput2#157
- [2019-09-20 00:09] Validation started with lhcb-run2-patches-dev4#84
- [2019-09-20 00:09] Validation started with lhcb-tdr-test#679
- [2019-09-20 00:09] Validation started with lhcb-gaudi-head#2392
- [2019-09-20 08:42] Validation started with lhcb-test-throughput2#16
- [2019-09-20 08:57] Validation started with lhcb-test-throughput2#17
- [2019-09-20 09:34] Validation started with lhcb-test-throughput2#18
Edited by Software for LHCb- Resolved by Gerhard Raven
mentioned in commit 06b53b72
Please register or sign in to reply