diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-23 12:02:50 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-23 12:02:50 -0400 |
commit | 7a74aa7f4a5666e5b50c30d57b00845337d51906 (patch) | |
tree | 8964373055aeb89d1de165408b6d246cf9109a01 | |
parent | 09e640b34df2fd4f0413f6984194606e97191292 (diff) | |
download | gcc-7a74aa7f4a5666e5b50c30d57b00845337d51906.zip gcc-7a74aa7f4a5666e5b50c30d57b00845337d51906.tar.gz gcc-7a74aa7f4a5666e5b50c30d57b00845337d51906.tar.bz2 |
* semantics.c (potential_constant_expression_1): Allow 'this'.
From-SVN: r177993
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 14 |
2 files changed, 4 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 39f1d31..524a685 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 59b25e5..1f6b49a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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: |