diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2012-11-07 11:15:40 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-11-07 11:15:40 +0000 |
commit | e1dfe00531385492850be7b5d8f2aa32b3b32f1c (patch) | |
tree | 57d8f1f4f0f9fb11cd2b1d2d1eb2eb43ae178540 /gcc | |
parent | 44c0e7b9250baf6205391c4a0c96ff1eb90a5ab1 (diff) | |
download | gcc-e1dfe00531385492850be7b5d8f2aa32b3b32f1c.zip gcc-e1dfe00531385492850be7b5d8f2aa32b3b32f1c.tar.gz gcc-e1dfe00531385492850be7b5d8f2aa32b3b32f1c.tar.bz2 |
re PR c++/55226 (ICE regression in regard to anonymous unions and constexpr)
/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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C | 13 |
4 files changed, 27 insertions, 25 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c623b5e..339a835 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 073ee97..7def254 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 23f142a..9b21b4c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 5695cb2..0000000 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C +++ /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() {} -}; |