]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: constexpr new diagnostic location
authorJason Merrill <jason@redhat.com>
Mon, 10 Mar 2025 15:49:57 +0000 (11:49 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 17 Apr 2025 17:21:09 +0000 (13:21 -0400)
commit4cff0434e8bf6683988482a7e47f8459c06f2c05
tree3fd6df1a69be53b4bbfe396c65e87f3d6f212769
parent53d4e355db18fec21515d055924df8290ef5ce14
c++: constexpr new diagnostic location

Presenting the allocation location as the location of the outermost
expression we're trying to evaluate is inaccurate; let's provide both
locations.

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_outermost_constant_expr): Give both
expression and allocation location in allocated storage diagnostics.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/constexpr-new.C: Adjust diagnostics.
* g++.dg/cpp1z/constexpr-asm-5.C: Likewise.
* g++.dg/cpp26/static_assert1.C: Likewise.
* g++.dg/cpp2a/constexpr-dtor7.C: Likewise.
* g++.dg/cpp2a/constexpr-new26.C: Likewise.
* g++.dg/cpp2a/constexpr-new3.C: Likewise.
* g++.dg/cpp2a/constinit14.C: Likewise.
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C
gcc/testsuite/g++.dg/cpp26/static_assert1.C
gcc/testsuite/g++.dg/cpp2a/constexpr-dtor7.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
gcc/testsuite/g++.dg/cpp2a/constinit14.C