Closed Quuxplusone closed 4 years ago
Attached file_35824.txt
(157 bytes, text/plain): repro file
I still have this issue on Clang-Tidy 6.0.0
BTW, the check is now called bugprone-suspicious-semicolon.
A fix is proposed in https://reviews.llvm.org/D46027 with some questions.
Appears to be related to 32203 as well.
Sorry for the inactivity. Feel free to commandeer the patch, I have no idea when can I return to solve this problem.
In the meantime https://reviews.llvm.org/D46233 was merged and https://reviews.llvm.org/D46234 was proposed as an alternative fix.
Still here in LLVM 8 distribution
Still/Again there in trunk: https://godbolt.org/z/xNtkWX
I just ran into this issue with the following code:
template<typename ERROR = fatal_error, typename... ARGS>
[[noreturn]] auto
fatal(ARGS &&... args) -> void
{
details::debug::print<0>(
magenta, "FATAL", std::forward<ARGS>(args)...);
if constexpr (autosar_compliant) { // <------ triggers false positive
throw ERROR{};
}
#ifndef BSL_FATAL_EXIT_INSTEAD_OF_ABORT
std::abort(); //NOSONAR
#else
std::exit(1); //NOSONAR
#endif
}
It seems that this bug has been in Clang Tidy for come time. Are there any
plans to address this?
https://reviews.llvm.org/D46027 is still there to work this issue around for more than a year. It comes at the cost of some false negatives. Unfortunately, I do not have time to work on some other solutions. If no one volunteers to pick it up I would suggest to merge https://reviews.llvm.org/D46027.
Ok, the quick fix should now be committed in https://github.com/llvm/llvm-project/commit/5c5e860535d8924a3d6eb950bb8a4945df01e9b7 .
file_35824.txt
(157 bytes, text/plain)