Index: clang/lib/AST/Interp/ByteCodeExprGen.cpp =================================================================== --- clang/lib/AST/Interp/ByteCodeExprGen.cpp +++ clang/lib/AST/Interp/ByteCodeExprGen.cpp @@ -150,6 +150,7 @@ case CK_NonAtomicToAtomic: case CK_NoOp: case CK_UserDefinedConversion: + case CK_BitCast: return this->visit(SubExpr); case CK_IntegralToBoolean: Index: clang/test/AST/Interp/literals.cpp =================================================================== --- clang/test/AST/Interp/literals.cpp +++ clang/test/AST/Interp/literals.cpp @@ -90,6 +90,11 @@ static_assert(p != nullptr, ""); static_assert(*p == 10, ""); +constexpr const void *cp = (void *)p; +// FIXME: This should be an error in the new interpreter. +constexpr const int *pm = (int*)cp; // ref-error {{ must be initialized by a constant expression}} \ + // ref-note {{cast from 'const void *' is not allowed}} + constexpr const int* getIntPointer() { return &m; }