diff options
author | Jason Merrill <jason@redhat.com> | 2015-06-09 12:56:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-06-09 12:56:12 -0400 |
commit | 34f42d7bf400ba0facaa38ee9fee21b639d28146 (patch) | |
tree | 9ff1e3596b3a9f1bd1451464094696957e5a8041 /gcc | |
parent | 86b76c209b26dba6ebeacd9464cfb4df75ff9e6e (diff) | |
download | gcc-34f42d7bf400ba0facaa38ee9fee21b639d28146.zip gcc-34f42d7bf400ba0facaa38ee9fee21b639d28146.tar.gz gcc-34f42d7bf400ba0facaa38ee9fee21b639d28146.tar.bz2 |
DR 1467 PR c++/51747
DR 1467
PR c++/51747
* typeck2.c (digest_init_r): Replace previous change with
gcc_unreachable.
From-SVN: r224289
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 089f693..35a1345 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2015-06-09 Jason Merrill <jason@redhat.com> + DR 1467 + PR c++/51747 + * typeck2.c (digest_init_r): Replace previous change with + gcc_unreachable. + PR c++/66387 * semantics.c (process_outer_var_ref): Make sure the value is actually constant before returning it. diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index b077f02..709875c 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1089,6 +1089,7 @@ digest_init_r (tree type, tree init, bool nested, int flags, || TREE_CODE (type) == UNION_TYPE || TREE_CODE (type) == COMPLEX_TYPE); +#ifdef ENABLE_CHECKING /* "If T is a class type and the initializer list has a single element of type cv U, where U is T or a class derived from T, the object is initialized from that element." */ @@ -1099,8 +1100,10 @@ digest_init_r (tree type, tree init, bool nested, int flags, { tree elt = CONSTRUCTOR_ELT (init, 0)->value; if (reference_related_p (type, TREE_TYPE (elt))) - init = elt; + /* We should have fixed this in reshape_init. */ + gcc_unreachable (); } +#endif if (BRACE_ENCLOSED_INITIALIZER_P (init) && !TYPE_NON_AGGREGATE_CLASS (type)) |