Missing lvalue-to-rvalue cast for first arg of ->* ?

When dumping the AST for the following C++ program:

struct B { int mem; };

void foo(B* pb, int B::* pmem) {

it can be seen that the lvalue pointer pd, when used as the first
argument of MemberExpr pb->mem, is subject to an LValueToRValue implicit

This is not the case when pb is used as the first argument in the
member-pointer operator ->*.

Similarly, lvalue member-pointers (such as pmem) occurring as the second
argument of ->* and .* operators are not subject to LValueToRValue
implicit casts.

Is this difference meant (and why)?

In our experience, the presence of these LValueToRValue casts is very
useful to simplify the logic of custom AST visitors.


No, it isn't. Thanks for pointing it out; fixed in r134170.


Thank you for the very quick fix!

I have another question, regarding the AST structure of
CXXPseudoDestructorExpr nodes.

It's possible to have a DTST without an NNS; this is one case,
and another would be something like:

  foor->template A<T>::bah();

Basically, we use a DTST whenever we can't do the lookup for the
template name yet, but we nonetheless know it has to be a template
and has to be a type.