diff options
author | Jason Merrill <jason@redhat.com> | 2016-02-25 09:09:24 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-02-25 09:09:24 -0500 |
commit | 6a0cc1cd6c5f5fbc4675ac7c3e7a899a3d8d4475 (patch) | |
tree | 8e2618e7f5fc2657d1aaafa6af83711025837194 /gcc/cp | |
parent | 6284a979dba8e74efe6c36b33311f1b4bac10f44 (diff) | |
download | gcc-6a0cc1cd6c5f5fbc4675ac7c3e7a899a3d8d4475.zip gcc-6a0cc1cd6c5f5fbc4675ac7c3e7a899a3d8d4475.tar.gz gcc-6a0cc1cd6c5f5fbc4675ac7c3e7a899a3d8d4475.tar.bz2 |
re PR c++/67364 ("accessing uninitialized member" error in constexpr context)
PR c++/67364
* constexpr.c (cxx_eval_component_reference): Don't complain about
unevaluated empty classes.
From-SVN: r233716
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eb5cfe6..97296e4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2016-02-25 Jason Merrill <jason@redhat.com> + PR c++/67364 + * constexpr.c (cxx_eval_component_reference): Don't complain about + unevaluated empty classes. + PR c++/68049 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE. diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index d3b04b1..8d9168c 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -1983,7 +1983,8 @@ cxx_eval_component_reference (const constexpr_ctx *ctx, tree t, return t; } - if (CONSTRUCTOR_NO_IMPLICIT_ZERO (whole)) + if (CONSTRUCTOR_NO_IMPLICIT_ZERO (whole) + && !is_empty_class (TREE_TYPE (part))) { /* 'whole' is part of the aggregate initializer we're currently building; if there's no initializer for this member yet, that's an |