* gcc/cp/semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
stripped child trees that are not pointer types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185890
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-03-27 Meador Inge <meadori@codesourcery.com>
+
+ PR c++/52672
+ * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
+ stripped child trees that are not pointer types.
+
2012-03-21 Jason Merrill <jason@redhat.com>
Implement return type deduction for normal functions with -std=c++1y.
sub = op0;
STRIP_NOPS (sub);
subtype = TREE_TYPE (sub);
- gcc_assert (POINTER_TYPE_P (subtype));
+ if (!POINTER_TYPE_P (subtype))
+ return NULL_TREE;
if (TREE_CODE (sub) == ADDR_EXPR)
{
+2012-03-27 Meador Inge <meadori@codesourcery.com>
+
+ PR c++/52672
+ * g++.dg/cpp0x/constexpr-52672.C: New testcase.
+
2012-03-27 Mike Stump <mikestump@comcast.net>
PR target/52665
--- /dev/null
+// PR c++/52672
+// { dg-do compile }
+// { dg-options "-std=c++11" }
+
+typedef unsigned long * ul_ptr;
+constexpr unsigned long a = *((ul_ptr)0x0); // { dg-error "" }
+constexpr unsigned long b = *((ul_ptr)(*((ul_ptr)0x0))); // { dg-error "" }
+constexpr unsigned long c = *((ul_ptr)*((ul_ptr)(*((ul_ptr)0x0)))); // { dg-error "" }