The following code gives me now a regressive ICE when switching from my previous gcc 4.8 (last successfully tested: 4.8.0 20121014 (experimental)) to gcc 4.8.0 20121104 (experimental) using the compiler flags -Wall -pedantic -std=c++11 //---------------------- template<class T> struct optional_data { union { unsigned char for_value_init_; T value_; }; constexpr optional_data() : for_value_init_() {} }; struct ncnm { ncnm(ncnm&&) = delete; ncnm(const ncnm&) = delete; }; int main() { optional_data<ncnm> o; // #20 } //---------------------- "In function 'int main()':| 20|internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:3787| " A tentative guess is that this could have been a side-effect of the fix applied to bug 54922.
I'm going to revert for now the fix for 54922. This one is essentially just a duplicate of that one, simply trying to use the user defined type: class nullable_int { bool init_; union { unsigned char for_value_init; int value_; }; public: constexpr nullable_int() : init_(false), for_value_init() {} }; int main() { nullable_int n; }
Author: paolo Date: Wed Nov 7 11:15:40 2012 New Revision: 193292 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193292 Log: /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. Removed: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
See PR54922. *** This bug has been marked as a duplicate of bug 54922 ***