https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113127
Bug ID: 113127
Summary: Unexpected error: '<anonymous>' was not declared
'constexpr'
Product: gcc
Version: 13.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
This constexpr variable definition
constexpr bool b = ( delete [][]{ return new int[2]; }(), true );
is accepted in Clang and MSVC. But GCC complains:
<source>:1:64: error: the value of '<anonymous>' is not usable in a
constant
<source>:1:56: note: '<anonymous>' was not declared 'constexpr'
Online demo: https://godbolt.org/z/ovso3neEr