re PR c++/55226 (ICE regression in regard to anonymous unions and constexpr)
authorPaolo Carlini <paolo@gcc.gnu.org>
Wed, 7 Nov 2012 11:15:40 +0000 (11:15 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 7 Nov 2012 11:15:40 +0000 (11:15 +0000)
/cp
2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/55226
Revert:
2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/54922
* semantics.c (cx_check_missing_mem_inits): Handle anonymous union
members.

/testsuite
2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/55226
Revert:
2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r193292

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C [deleted file]

index c623b5e..339a835 100644 (file)
@@ -1,3 +1,13 @@
+2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55226
+       Revert:
+       2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54922
+       * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
+       members.
+
 2012-11-07  Florian Weimer  <fweimer@redhat.com>
 
        * init.c (build_new_1): Do not check for arithmetic overflow if
@@ -12,7 +22,7 @@
        * decl.c (decls_match): Make decls unmatched for versioned
        functions.
        (duplicate_decls): Remove ambiguity for versioned functions.
-       Delete versioned function data for merged decls. 
+       Delete versioned function data for merged decls.
        * decl2.c (check_classfn): Check attributes of versioned functions
        for match.
        * call.c (get_function_version_dispatcher): New function.
index 073ee97..7def254 100644 (file)
@@ -6139,23 +6139,17 @@ cx_check_missing_mem_inits (tree fun, tree body, bool complain)
   for (i = 0; i <= nelts; ++i)
     {
       tree index;
-      tree anon_union_init_type = NULL_TREE;
       if (i == nelts)
        index = NULL_TREE;
       else
        {
          index = CONSTRUCTOR_ELT (body, i)->index;
-         /* Handle anonymous union members.  */
-         if (TREE_CODE (index) == COMPONENT_REF
-             && ANON_UNION_TYPE_P (TREE_TYPE (TREE_OPERAND (index, 0))))
-           anon_union_init_type = TREE_TYPE (TREE_OPERAND (index, 0));
          /* Skip base and vtable inits.  */
-         else if (TREE_CODE (index) != FIELD_DECL
-                  || DECL_ARTIFICIAL (index))
+         if (TREE_CODE (index) != FIELD_DECL
+             || DECL_ARTIFICIAL (index))
            continue;
        }
-      for (; field != index && TREE_TYPE (field) != anon_union_init_type;
-          field = DECL_CHAIN (field))
+      for (; field != index; field = DECL_CHAIN (field))
        {
          tree ftype;
          if (TREE_CODE (field) != FIELD_DECL
index 23f142a..9b21b4c 100644 (file)
@@ -1,3 +1,12 @@
+2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55226
+       Revert:
+       2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54922
+       * g++.dg/cpp0x/constexpr-union4.C: New.
+
 2012-11-07  Yufeng Zhang  <yufeng.zhang@arm.com>
 
        * gcc.target/aarch64/dwarf-cfa-reg.c: New test.
@@ -17,7 +26,8 @@
 
 2012-11-06  Andrew Pinski  <apinski@cavium.com>
 
-       * gcc.target/aarch64/vect-fmaxv-fminv-compile.c: Add -fno-vect-cost-model.
+       * gcc.target/aarch64/vect-fmaxv-fminv-compile.c: Add
+       -fno-vect-cost-model.
 
 2012-11-06  Aldy Hernandez  <aldyh@redhat.com>
 
@@ -37,7 +47,8 @@
 
 2012-11-06  Jan Hubicka  <jh@suse.cz>
 
-       * gcc.dg/tree-ssa/loop-1.c: Make to look like a good unroling candidate still.
+       * gcc.dg/tree-ssa/loop-1.c: Make to look like a good unroling
+       candidate still.
        * gcc.dg/tree-ssa/loop-23.c: Likewise.
        * gcc.dg/tree-ssa/cunroll-1.c: Unrolling now happens early.
        * gcc.dg/tree-prof/unroll-1.c: Remove confused dg-options.
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C
deleted file mode 100644 (file)
index 5695cb2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// PR c++/54922
-// { dg-do compile { target c++11 } }
-
-class nullable_int
-{
-  bool init_;
-  union {
-    unsigned char for_value_init;
-    int value_;
-  };
-public:
-  constexpr nullable_int() : init_(false), for_value_init() {}
-};