aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-10-03 00:31:58 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-10-03 00:31:58 +0200
commit276a52d5566487fa53bcf34f24290362a10ac316 (patch)
tree3e73647db951b063af573a56b42b19d3e9f78c0f /gcc/cp
parentbead578432b67889c2700c7f0eafa72d74bf197b (diff)
downloadgcc-276a52d5566487fa53bcf34f24290362a10ac316.zip
gcc-276a52d5566487fa53bcf34f24290362a10ac316.tar.gz
gcc-276a52d5566487fa53bcf34f24290362a10ac316.tar.bz2
constexpr.c (cxx_eval_store_expression): Formatting fix.
* constexpr.c (cxx_eval_store_expression): Formatting fix. Handle const_object_being_modified with array type. From-SVN: r276493
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/constexpr.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 275fc9f..f2c1aa2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-03 Jakub Jelinek <jakub@redhat.com>
+
+ * constexpr.c (cxx_eval_store_expression): Formatting fix. Handle
+ const_object_being_modified with array type.
+
2019-10-02 Jason Merrill <jason@redhat.com>
* typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 06672a2..a6a55b9 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -3895,7 +3895,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
bool no_zero_init = true;
releasing_vec ctors;
- while (!refs->is_empty())
+ while (!refs->is_empty ())
{
if (*valp == NULL_TREE)
{
@@ -4036,7 +4036,9 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
if (const_object_being_modified)
{
bool fail = false;
- if (!CLASS_TYPE_P (TREE_TYPE (const_object_being_modified)))
+ tree const_objtype
+ = strip_array_types (TREE_TYPE (const_object_being_modified));
+ if (!CLASS_TYPE_P (const_objtype))
fail = true;
else
{