Unusual cast kinds

Hi all,

In IWYU [1], we traverse the AST trying to deduce if the use of a
symbol requires a full declaration or if a forward declaration is

One of the things we're looking at are cast-expressions, and there are
two kinds we currently don't cover:


The docstrings for them don't give examples of what they might look
like, and I'm having trouble coming up with representative examples.
Can anyone help? And maybe add examples to the docstrings for these
two kinds?


- Kim

[1] http://code.google.com/p/include-what-you-use/

The comment in SemaCast.cpp says that the second kind deals with C++ 5.2.10p9:

An rvalue of type “pointer to member of X of type T1” can be explicitly converted to an rvalue of type “pointer to member of Y of type T2” if T1 and T2 are both function types or both object types.

This is the code that I tried

class X {
int a;

class Y {
int b;

int main() {
int X::*xptr = &X::a;
int Y::yptr = reinterpret_cast<int Y::>(xptr);

Take a look at diff for r162962, which added it.