aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-01-21 17:30:26 -0500
committerJason Merrill <jason@gcc.gnu.org>2011-01-21 17:30:26 -0500
commit62f9aedcd0a97001f290a1c13fa66efd207a23cc (patch)
tree84025dd18551194bb39bf65f3c1d9339ebbeadeb /gcc/cp
parent12c30f2fba6037d7bc4f4e7e3c291f84810c3825 (diff)
downloadgcc-62f9aedcd0a97001f290a1c13fa66efd207a23cc.zip
gcc-62f9aedcd0a97001f290a1c13fa66efd207a23cc.tar.gz
gcc-62f9aedcd0a97001f290a1c13fa66efd207a23cc.tar.bz2
re PR c++/47041 (Internal compiler error in build_data_member_initialization, add cp/semantics.c:5483)
PR c++/47041 * semantics.c (build_constexpr_constructor_member_initializers): Handle trivial copy. From-SVN: r169108
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0e7bcb0..81e4457 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/47041
+ * semantics.c (build_constexpr_constructor_member_initializers):
+ Handle trivial copy.
+
2011-01-21 Jakub Jelinek <jakub@redhat.com>
PR c++/47388
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ba90515..dc29c7a 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5607,7 +5607,20 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
body = STATEMENT_LIST_HEAD (body)->stmt;
body = BIND_EXPR_BODY (body);
if (TREE_CODE (body) == CLEANUP_POINT_EXPR)
- ok = build_data_member_initialization (body, &vec);
+ {
+ body = TREE_OPERAND (body, 0);
+ if (TREE_CODE (body) == EXPR_STMT)
+ body = TREE_OPERAND (body, 0);
+ if (TREE_CODE (body) == INIT_EXPR
+ && (same_type_ignoring_top_level_qualifiers_p
+ (TREE_TYPE (TREE_OPERAND (body, 0)),
+ current_class_type)))
+ {
+ /* Trivial copy. */
+ return TREE_OPERAND (body, 1);
+ }
+ ok = build_data_member_initialization (body, &vec);
+ }
else if (TREE_CODE (body) == STATEMENT_LIST)
{
tree_stmt_iterator i;