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: r200830
This commit is contained in:
Jason Merrill 2013-07-09 13:50:24 -04:00 committed by Jason Merrill
parent 2a1b2f1c26
commit e7654c6325
3 changed files with 13 additions and 5 deletions

View File

@ -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.

View File

@ -7459,11 +7459,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

View File

@ -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;
}