c++: non-array new alignment [PR102071]
authorJason Merrill <jason@redhat.com>
Tue, 12 Apr 2022 20:06:18 +0000 (16:06 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 12 Apr 2022 20:45:41 +0000 (16:45 -0400)
commit164c6a1c5d7f99235f1a41440eacac7a977e8fbd
treeb1bc9e232808f648390684d2099a6976c3070e46
parentaa7874596b9f12b25a3214b0a143b040fafa1f10
c++: non-array new alignment [PR102071]

While considering the PR102071 patch for backporting, I noticed that I was
considering the alignment of the array new cookie even when there isn't one
because we aren't allocating an array.

PR c++/102071

gcc/cp/ChangeLog:

* init.cc (build_new_1): Check array_p for alignment.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/aligned-new9.C: Add single-object test.
gcc/cp/init.cc
gcc/testsuite/g++.dg/cpp1z/aligned-new9.C