diff options
author | ppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-22 00:30:57 +0000 |
---|---|---|
committer | ppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-22 00:30:57 +0000 |
commit | c8e3e744939ed08d70ca7a21f5601a55a7654103 (patch) | |
tree | af672fb47ac92ddcd639ed7b300f915292b19432 /gcc/cp | |
parent | 8912988c86a2c5421d2ceec3ad8f012f6a5bd9be (diff) | |
download | gcc-c8e3e744939ed08d70ca7a21f5601a55a7654103.tar.gz |
Fix PR c++/70204 (ICE in non_const_var_error)
gcc/cp/ChangeLog:
PR c++/70204
* constexpr.c (non_const_var_error): Check
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
gcc/testsuite/ChangeLog:
PR c++/70204
* g++.dg/cpp0x/constexpr-70204a.C: New test.
* g++.dg/cpp0x/constexpr-70204b.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234390 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c8919f9437e..578fc6fba35 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-03-22 Patrick Palka <ppalka@gcc.gnu.org> + + PR c++/70204 + * constexpr.c (non_const_var_error): Check + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + 2016-03-21 Richard Henderson <rth@redhat.com> PR c++/70273 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 1f496b5f9bd..7b136330b3f 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -2763,7 +2763,8 @@ non_const_var_error (tree r) inform (DECL_SOURCE_LOCATION (r), "%q#D is volatile", r); else if (!DECL_INITIAL (r) - || !TREE_CONSTANT (DECL_INITIAL (r))) + || !TREE_CONSTANT (DECL_INITIAL (r)) + || !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (r)) inform (DECL_SOURCE_LOCATION (r), "%qD was not initialized with a constant " "expression", r); |