diff options
author | Jason Merrill <jason@redhat.com> | 2011-04-11 18:01:04 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-04-11 18:01:04 -0400 |
commit | 80c6dcf59bf7b192f107a2d950877a6b09fc6084 (patch) | |
tree | 3b58eebc8734149498c7501b9210b12e419ac019 /gcc/cp/semantics.c | |
parent | 76186d20ccf5c5c34f5f4fe2e721738d28890a4a (diff) | |
download | gcc-80c6dcf59bf7b192f107a2d950877a6b09fc6084.zip gcc-80c6dcf59bf7b192f107a2d950877a6b09fc6084.tar.gz gcc-80c6dcf59bf7b192f107a2d950877a6b09fc6084.tar.bz2 |
re PR c++/48535 ([C++0x][SFINAE] Hard errors during list-value-initialization)
PR c++/48535
* decl.c (cp_complete_array_type_or_error): New.
* semantics.c (finish_compound_literal): Use it.
* cp-tree.h: Declare it.
From-SVN: r172287
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 461aa0a..61d87be 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2355,8 +2355,14 @@ finish_compound_literal (tree type, tree compound_literal, && check_array_initializer (NULL_TREE, type, compound_literal)) return error_mark_node; compound_literal = reshape_init (type, compound_literal); - if (TREE_CODE (type) == ARRAY_TYPE) - cp_complete_array_type (&type, compound_literal, false); + if (TREE_CODE (type) == ARRAY_TYPE + && TYPE_DOMAIN (type) == NULL_TREE) + { + cp_complete_array_type_or_error (&type, compound_literal, + false, complain); + if (type == error_mark_node) + return error_mark_node; + } compound_literal = digest_init (type, compound_literal); /* Put static/constant array temporaries in static variables, but always represent class temporaries with TARGET_EXPR so we elide copies. */ |