aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-07-09 13:55:43 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-07-09 13:55:43 -0400
commit7eb48705c0b12d73651de15cd9a9a415c7229039 (patch)
treefe59ac64a4c24b618fdcb161fd7d834d60185a10 /gcc
parent1d0859d8946995f64be3b422b1c54e9a5c78905e (diff)
downloadgcc-7eb48705c0b12d73651de15cd9a9a415c7229039.zip
gcc-7eb48705c0b12d73651de15cd9a9a415c7229039.tar.gz
gcc-7eb48705c0b12d73651de15cd9a9a415c7229039.tar.bz2
re PR regression/57551 (g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE)
PR c++/57551 * semantics.c (cxx_eval_indirect_ref): Don't try to look through a POINTER_PLUS_EXPR for type punning diagnostic. From-SVN: r200840
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/semantics.c5
-rw-r--r--gcc/testsuite/g++.dg/expr/const1.C9
3 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index aa6bdb1..87892aa 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2013-07-09 Jason Merrill <jason@redhat.com>
+ PR c++/57551
+ * semantics.c (cxx_eval_indirect_ref): Don't try to look through
+ a POINTER_PLUS_EXPR for type punning diagnostic.
+
PR c++/57831
* pt.c (tsubst_copy): Handle USING_DECL.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c9a292e..e06ac61 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7715,11 +7715,6 @@ cxx_eval_indirect_ref (const constexpr_call *call, tree t,
{
tree sub = op0;
STRIP_NOPS (sub);
- if (TREE_CODE (sub) == POINTER_PLUS_EXPR)
- {
- sub = TREE_OPERAND (sub, 0);
- STRIP_NOPS (sub);
- }
if (TREE_CODE (sub) == ADDR_EXPR)
{
/* We couldn't fold to a constant value. Make sure it's not
diff --git a/gcc/testsuite/g++.dg/expr/const1.C b/gcc/testsuite/g++.dg/expr/const1.C
new file mode 100644
index 0000000..9371b27
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/const1.C
@@ -0,0 +1,9 @@
+// PR c++/57551
+
+extern unsigned long ADDR;
+
+unsigned long f(){
+ const unsigned long* const var=&ADDR;
+ const unsigned long retval=var[1];
+ return retval;
+}