aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-20 22:24:17 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-20 22:24:17 -0400
commitfe7eb484d309fefb7366b3838900e632da9dd234 (patch)
tree34baaeacaa4ccbe65ec562c07c7c1a3b6fbf5f48 /gcc/cp/init.c
parent344bf2e1a23979f149b9489155dfe2ee74e38273 (diff)
downloadgcc-fe7eb484d309fefb7366b3838900e632da9dd234.zip
gcc-fe7eb484d309fefb7366b3838900e632da9dd234.tar.gz
gcc-fe7eb484d309fefb7366b3838900e632da9dd234.tar.bz2
re PR c++/49216 ([C++0x] ICE on compiling new-expression with braced-init-list for arrays)
PR c++/49216 * init.c (build_vec_init): Don't try to use a CONSTRUCTOR when base is a pointer. * typeck2.c (process_init_constructor_array): Use {} for classes, too. * call.c (convert_like_real): Handle substitution failure. From-SVN: r175237
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 140e064..3c347a4 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3082,8 +3082,9 @@ build_vec_init (tree base, tree maxindex, tree init,
unsigned HOST_WIDE_INT idx;
tree field, elt;
/* Should we try to create a constant initializer? */
- bool try_const = (literal_type_p (inner_elt_type)
- || TYPE_HAS_CONSTEXPR_CTOR (inner_elt_type));
+ bool try_const = (TREE_CODE (atype) == ARRAY_TYPE
+ && (literal_type_p (inner_elt_type)
+ || TYPE_HAS_CONSTEXPR_CTOR (inner_elt_type)));
bool saw_non_const = false;
bool saw_const = false;
/* If we're initializing a static array, we want to do static