diff options
author | Marek Polacek <polacek@redhat.com> | 2019-12-11 18:40:55 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-12-11 18:40:55 +0000 |
commit | c20f7e9971d35b89f17ee6a1bc8ab2462288adda (patch) | |
tree | eb39bd0f839f4939287f6b18c8f54fcb813f932f /gcc/function-tests.c | |
parent | cc3b6728a21185a418f81bed6142fcdec565cd89 (diff) | |
download | gcc-c20f7e9971d35b89f17ee6a1bc8ab2462288adda.zip gcc-c20f7e9971d35b89f17ee6a1bc8ab2462288adda.tar.gz gcc-c20f7e9971d35b89f17ee6a1bc8ab2462288adda.tar.bz2 |
PR c++/92878 - Parenthesized init of aggregates in new-expression.
Ville pointed out that our paren init of aggregates doesn't work for
auto a = new A(1, 2, 3);
and I think it should:
A new-expression that creates an object of type T initializes that object
as follows:
...
-- Otherwise, the new-initializer is interpreted according to the
initialization rules of [dcl.init] for direct-initialization.
so I think it follows that we should perform dcl.init#17.6.2.2.
This doesn't work with new[]; we have:
error ("parenthesized initializer in array new");
* init.c (build_new_1): Handle parenthesized initialization of
aggregates in new-expression.
* g++.dg/cpp2a/paren-init20.C: New test.
From-SVN: r279240
Diffstat (limited to 'gcc/function-tests.c')
0 files changed, 0 insertions, 0 deletions