diff options
author | Jason Merrill <jason@redhat.com> | 2011-04-11 18:00:53 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-04-11 18:00:53 -0400 |
commit | 76186d20ccf5c5c34f5f4fe2e721738d28890a4a (patch) | |
tree | c5c12029e3a638d691f82144a54a3409da5df651 | |
parent | 834aa42659a1408370b8dc323a3ccd2334ce5e16 (diff) | |
download | gcc-76186d20ccf5c5c34f5f4fe2e721738d28890a4a.zip gcc-76186d20ccf5c5c34f5f4fe2e721738d28890a4a.tar.gz gcc-76186d20ccf5c5c34f5f4fe2e721738d28890a4a.tar.bz2 |
re PR c++/48535 ([C++0x][SFINAE] Hard errors during list-value-initialization)
PR c++/48535
* semantics.c (finish_compound_literal): Handle references.
From-SVN: r172286
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6732794..d5975fc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,6 +1,9 @@ 2011-04-11 Jason Merrill <jason@redhat.com> PR c++/48535 + * semantics.c (finish_compound_literal): Handle references. + + PR c++/48535 * semantics.c (finish_compound_literal): Take complain parm. (build_lambda_object): Adjust. * cp-tree.h: Adjust. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e08ddb3..461aa0a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2315,6 +2315,14 @@ finish_compound_literal (tree type, tree compound_literal, if (type == error_mark_node) return error_mark_node; + if (TREE_CODE (type) == REFERENCE_TYPE) + { + compound_literal + = finish_compound_literal (TREE_TYPE (type), compound_literal, + complain); + return cp_build_c_cast (type, compound_literal, complain); + } + if (!TYPE_OBJ_P (type)) { if (complain & tf_error) |