https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103991
Bug ID: 103991 Summary: Bogus -Wreturn-type with constexpr if and local var with destructor Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sbergman at redhat dot com Target Milestone: --- Apparently a recent regression on GCC trunk: > $ cat test.cc > struct S { ~S(); }; > int f() { > S s; > if constexpr (true) return 0; > else return 0; > } > $ g++ -c test.cc > test.cc: In function ‘int f()’: > test.cc:6:1: warning: control reaches end of non-void function [-Wreturn-type] > 6 | } > | ^