re PR c++/49776 ([C++0x]ICE in build_data_member_initialization, at cp/semantics...
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 26 Jul 2011 20:00:31 +0000 (20:00 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 26 Jul 2011 20:00:31 +0000 (20:00 +0000)
/cp
2011-07-26  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/49776
* typeck.c (cp_build_modify_expr): Check digest_init return value
for error_mark_node.

/testsuite
2011-07-26  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/49776
* g++.dg/cpp0x/constexpr-49776.C: New.

From-SVN: r176809

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C [new file with mode: 0644]

index fe6b7da9c8b0476ca45fb20bf11e22d2b020c8c6..d169ed14a33dc77643b44e0c498a8388a638b8e5 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/49776
+       * typeck.c (cp_build_modify_expr): Check digest_init return value
+       for error_mark_node.
+
 2011-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR bootstrap/49845
index 52084e6ae40bb83f081df231f53ef87725be9f1f..ab08eae28590aae9b063b99a13dd771646fa12b6 100644 (file)
@@ -6753,6 +6753,8 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
          if (check_array_initializer (lhs, lhstype, newrhs))
            return error_mark_node;
          newrhs = digest_init (lhstype, newrhs, complain);
+         if (newrhs == error_mark_node)
+           return error_mark_node;
        }
 
       else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype),
index b201960d301d6b39614006aecc800a24869d0e62..f0cb44b516761694e7da4de81961f7fcf758f79c 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/49776
+       * g++.dg/cpp0x/constexpr-49776.C: New.
+
 2011-07-26  Sebastian Pop  <sebastian.pop@amd.com>
 
        PR middle-end/47046
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C
new file mode 100644 (file)
index 0000000..3fe3dcb
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/49776
+// { dg-options -std=c++0x }
+
+struct s
+{
+  int i[1];
+
+  template<class... Types>
+    constexpr s(Types... args)
+    : i{args...}  // { dg-error "cannot convert" }
+    { }
+};
+
+int main()
+{
+  s test = nullptr;
+}