Hi, I was looking into dynamic allocation tracking, and found simple example which fails to compile: `constexpr auto f = (delete new int{42}, 32);` It seems GCC is not tracking dynamic allocations inside RHS of constexpr variable definition. This should be valid according to [expr.const] as the allocation is destroyed within evaluation of E (here `(delete new int{42}, 32)`) Other compilers do accept this snipper: https://compiler-explorer.com/z/zeae1MP9d The bug is present in all versions of GCC since support dynamic allocations inside constant evaluation (GCC 10).
Error I'm getting is: ``` <source>:1:43: error: the value of '<anonymous>' is not usable in a constant expression 1 | constexpr auto f = (delete new int{42}, 32); | ^ <source>:1:38: note: '<anonymous>' was not declared 'constexpr' 1 | constexpr auto f = (delete new int{42}, 32); | ^ Compiler returned: 1 ```
Dup. *** This bug has been marked as a duplicate of bug 105826 ***