commit 6b67d63a289ca3eabc15dc7d9be34a603e45810f
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jun 14 13:19:32 2011 -0400
2011-06-14 Jason Merrill <jason@redhat.com>
@@ -6793,8 +6793,6 @@ cxx_eval_indirect_ref (const constexpr_call *call, tree t,
else if (TREE_CODE (sub) == ADDR_EXPR
|| TREE_CODE (sub) == POINTER_PLUS_EXPR)
{
- gcc_assert (!same_type_ignoring_top_level_qualifiers_p
- (TREE_TYPE (TREE_TYPE (sub)), TREE_TYPE (t)));
/* FIXME Mike Miller wants this to be OK. */
if (!allow_non_constant)
error ("accessing value of %qE through a %qT glvalue in a "
new file mode 100644
@@ -0,0 +1,12 @@
+typedef unsigned T;
+struct S
+{
+ T foo (void);
+ static unsigned s1[16];
+};
+T
+S::foo ()
+{
+ T u = *(T *) (s1 + 10);
+ return u;
+}