blob: fa2952b735c8489a9dbf31df52ddf5c5f39e3046 [file] [log] [blame]
// PR c++/103991
// { dg-do compile { target c++17 } }
struct S { ~S(); };
int
foo ()
{
S s;
if constexpr (true)
return 0;
else
return 1;
} // { dg-bogus "control reaches end of non-void function" }
#if __cpp_if_consteval >= 202106L
constexpr int
bar ()
{
S s;
if consteval
{
return 0;
}
else
{
return 1;
}
} // { dg-bogus "control reaches end of non-void function" }
int
baz ()
{
return bar ();
}
#endif