Index: cfe/trunk/lib/Sema/SemaChecking.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaChecking.cpp +++ cfe/trunk/lib/Sema/SemaChecking.cpp @@ -4613,7 +4613,6 @@ case Stmt::CXXReinterpretCastExprClass: { Expr* SubExpr = cast(E)->getSubExpr(); switch (cast(E)->getCastKind()) { - case CK_BitCast: case CK_LValueToRValue: case CK_NoOp: case CK_BaseToDerived: @@ -4628,6 +4627,14 @@ case CK_ArrayToPointerDecay: return EvalVal(SubExpr, refVars, ParentDecl); + case CK_BitCast: + if (SubExpr->getType()->isAnyPointerType() || + SubExpr->getType()->isBlockPointerType() || + SubExpr->getType()->isObjCQualifiedIdType()) + return EvalAddr(SubExpr, refVars, ParentDecl); + else + return nullptr; + default: return nullptr; } Index: cfe/trunk/test/SemaCXX/PR20110.cpp =================================================================== --- cfe/trunk/test/SemaCXX/PR20110.cpp +++ cfe/trunk/test/SemaCXX/PR20110.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +// expected-no-diagnostics + +// FIXME: These templates should trigger errors in C++11 mode. + +template +class A { + char const *get_p() { return *p; } +}; +template +class B { + char const *get_p() { return p; } +}; +