https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123889
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |11.5.0
Summary|C++11 diagnostic about |[13/14/15/16 Regression]
|non-constexpr functions is |C++11 diagnostic about
|useless |non-constexpr functions is
| |useless
Known to fail| |12.1.0, 16.0
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC 11 still had the missing note following "because" but it did show the
problem at the start of the output:
123889.cc: In instantiation of 'constexpr int func(T) [with T = int]':
123889.cc:7:19: required from here
123889.cc:5:1: error: body of 'constexpr' function 'constexpr int func(T) [with
T = int]' not a return-statement
5 | }
| ^
123889.cc:7:23: error: non-constant condition for static assertion
7 | static_assert(func(1) == 1);
| ~~~~~~~~^~~~
123889.cc:7:19: error: 'constexpr int func(T) [with T = int]' called in a
constant expression
7 | static_assert(func(1) == 1);
| ~~~~^~~
123889.cc:2:15: note: 'constexpr int func(T) [with T = int]' is not usable as a
'constexpr' function because:
2 | constexpr int func(T) {
| ^~~~