diff options
author | Jason Merrill <jason@redhat.com> | 2014-01-27 23:31:07 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-01-27 23:31:07 -0500 |
commit | 1b87c9918084cc4cefecb3b34b4001b01583df25 (patch) | |
tree | 49f964226a836d3aca6a8b0c810891fb29512238 /gcc/cp | |
parent | 110740003a153d13ad8c1ea73aa909d9827d0f15 (diff) | |
download | gcc-1b87c9918084cc4cefecb3b34b4001b01583df25.zip gcc-1b87c9918084cc4cefecb3b34b4001b01583df25.tar.gz gcc-1b87c9918084cc4cefecb3b34b4001b01583df25.tar.bz2 |
re PR c++/58639 (ICE on self-referential struct member)
PR c++/58639
* call.c (build_aggr_conv): Reject value-initialization of reference.
From-SVN: r207166
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/call.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fdd9bca..99c00a2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-01-27 Jason Merrill <jason@redhat.com> + PR c++/58639 + * call.c (build_aggr_conv): Reject value-initialization of reference. + PR c++/58812 PR c++/58651 * call.c (convert_like_real): Give helpful error about excess braces diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b72f2d4..b3db840 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -894,6 +894,9 @@ build_aggr_conv (tree type, tree ctor, int flags, tsubst_flags_t complain) if (i < CONSTRUCTOR_NELTS (ctor)) val = CONSTRUCTOR_ELT (ctor, i)->value; + else if (TREE_CODE (ftype) == REFERENCE_TYPE) + /* Value-initialization of reference is ill-formed. */ + return NULL; else { if (empty_ctor == NULL_TREE) |