* semantics.c (potential_constant_expression_1): Allow 'this'.
authorJason Merrill <jason@redhat.com>
Tue, 23 Aug 2011 16:02:50 +0000 (12:02 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 23 Aug 2011 16:02:50 +0000 (12:02 -0400)
From-SVN: r177993

gcc/cp/ChangeLog
gcc/cp/semantics.c

index 39f1d310be4e85ab62fbf18c8a08deaa10193eb8..524a685da24bc25ffb810f879c042cf8a5d9f77d 100644 (file)
@@ -1,3 +1,7 @@
+2011-08-23  Jason Merrill  <jason@redhat.com>
+
+       * semantics.c (potential_constant_expression_1): Allow 'this'.
+
 2011-08-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/50158
index 59b25e5066a01750abf1758d329c00ca06b52ac3..1f6b49a847224e0556a0b333acfd0cb7ffd858be 100644 (file)
@@ -7681,21 +7681,7 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
     case IDENTIFIER_NODE:
       /* We can see a FIELD_DECL in a pointer-to-member expression.  */
     case FIELD_DECL:
-      return true;
-
     case PARM_DECL:
-      /* -- this (5.1) unless it appears as the postfix-expression in a
-            class member access expression, including the result of the
-            implicit transformation in the body of the non-static
-            member function (9.3.1);  */
-      /* FIXME this restriction seems pointless since the standard dropped
-        "potential constant expression".  */
-      if (is_this_parameter (t))
-        {
-          if (flags & tf_error)
-            error ("%qE is not a potential constant expression", t);
-          return false;
-        }
       return true;
 
     case AGGR_INIT_EXPR: