[Bug c++/82643] lambda capture breaks constexpr-ness of non-static const constexpr member call on non-constexpr value/variable

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 6 20:57:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82643

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-07-06
     Ever confirmed|0                           |1

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC 6 rejected that code with a more sensible diagnostic:

c.cc:14:30: error: the value of 'f' is not usable in a constant expression

GCC 7 regressed to saying:

c.cc:14:30: error: '__closure' is not a constant expression

Clang and EDG both reject the code, but diagnosing different lines.


More information about the Gcc-bugs mailing list