[cfe-commits] [PATCH] Remove PotentiallyPotentiallyEvaluated

Eli Friedman eli.friedman at gmail.com
Wed Jan 18 17:28:20 PST 2012


On Wed, Jan 18, 2012 at 5:22 PM, John McCall <rjmccall at apple.com> wrote:
> On Jan 18, 2012, at 4:53 PM, Eli Friedman wrote:
>> This patch passes all the regression tests except for one,
>> CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp, which I haven't
>> figured out how to fix. (The issue is that given a DeclRefExpr
>> pointing at a FieldDecl, there isn't any easy way to distinguish
>> whether it is part of member pointer formation.)
>
> A DeclRefExpr pointing at a FieldDecl should always be a part
> of member pointer formation.  Any other use would be a MemberExpr.

Code:
struct A { int a; };
int y = sizeof A::a;

Dump:
int y = (ImplicitCastExpr 0x7fd4840594e8 <<stdin>:2:9, col:19> 'int'
<IntegralCast>
  (UnaryExprOrTypeTraitExpr 0x7fd4840594c0 <col:9, col:19> 'unsigned
long' sizeof
    (DeclRefExpr 0x7fd484059488 <col:16, col:19> 'int' lvalue Field
0x7fd484059360 'a' 'int')))

-Eli




More information about the cfe-commits mailing list