[Bug c++/103991] [12 Regression] Bogus -Wreturn-type with constexpr if and local var with destructor
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 12 16:06:19 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103991
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Maybe better:
struct S { ~S(); };
int
foo ()
{
S s;
if constexpr (true)
return 0;
else
return 1;
}
#if __cpp_if_consteval >= 202106L
constexpr int
bar ()
{
S s;
if consteval
{
return 0;
}
else
{
return 1;
}
}
int
baz ()
{
return bar ();
}
#endif
More information about the Gcc-bugs
mailing list