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
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.
{
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
--- /dev/null
+// PR c++/57551
+
+extern unsigned long ADDR;
+
+unsigned long f(){
+ const unsigned long* const var=&ADDR;
+ const unsigned long retval=var[1];
+ return retval;
+}