bloomberg/clang-p2996

Crash on implicit access to a member named by a splice of a dependent reflection

Closed this issue · 2 comments

I'm not actually sure whether this should work or not, but it shouldn't yield a compiler crash either way. Example is here.

After discussion with P2996 co-authors, this should error in the absence of an explicit this-> prefix.

Note: This crash is also produced by splicing a reflection of a nonstatic data member, in a context other than taking its address or as the RHS of a member-access-expression, outside of its class's context.

The more general problem seems to be that when the CXXExprSpliceExpr is outside of a context in which the compiler specifically knows how to handle it it, the DeclRefExpr to it passes through to CodeGen, which says "I have no idea what to do with this."

We probably need to be a bit more rigorous about both the scope and the context within which such a DeclRefExpr is being created.