diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-07-09 22:40:07 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-07-09 22:40:07 -0400 |
commit | b9119edc09e4660d772dea771578715858f7fbdb (patch) | |
tree | 4b3c6fb7575e670996de09c0ae666b7b472a1098 /libgo | |
parent | ef2ace642a1ba795235c542b728cb83c73dfce74 (diff) | |
download | gcc-b9119edc09e4660d772dea771578715858f7fbdb.zip gcc-b9119edc09e4660d772dea771578715858f7fbdb.tar.gz gcc-b9119edc09e4660d772dea771578715858f7fbdb.tar.bz2 |
c++: 'new T[N]' and SFINAE [PR82110]
Here we're failing to treat 'new T[N]' as erroneous in a SFINAE context
when T isn't default constructible because expand_aggr_init_1 doesn't
communicate to build_aggr_init (its only SFINAE caller) whether the
initialization was actually successful. To fix this, this patch makes
expand_aggr_init_1 and its subroutine expand_default_init return true on
success, false on failure so that build_aggr_init can properly return
error_mark_node on failure.
PR c++/82110
gcc/cp/ChangeLog:
* init.c (build_aggr_init): Return error_mark_node if
expand_aggr_init_1 returns false.
(expand_default_init): Change return type to bool. Return false
on error, true on success.
(expand_aggr_init_1): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/pr78765.C: Expect another conversion failure
diagnostic.
* g++.dg/template/sfinae14.C: Flip incorrect assertion.
* g++.dg/cpp2a/concepts-requires27.C: New test.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions