[Bug c++/113582] incorrect warning about unused label
nmmm at nmmm dot nu
gcc-bugzilla@gcc.gnu.org
Wed Jan 24 14:31:22 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113582
--- Comment #1 from Nikolay Mihaylov <nmmm at nmmm dot nu> ---
If you move the pragma outside the templated function, no warning is shown:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-label"
template<bool B>
void do_something(){
start:
if constexpr(B)
goto start;
}
#pragma GCC diagnostic pop
More information about the Gcc-bugs
mailing list