From eee944e7f9e60df44714eb547d0b876ee5dc7290 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Tue, 2 Jul 2019 18:28:13 +0000 Subject: [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast This commit adds a new builtin, __builtin_bit_cast(T, v), which performs a bit_cast from a value v to a type T. This expression can be evaluated at compile time under specific circumstances. The compile time evaluation currently doesn't support bit-fields, but I'm planning on fixing this in a follow up (some of the logic for figuring this out is in CodeGen). I'm also planning follow-ups for supporting some more esoteric types that the constexpr evaluator supports, as well as extending __builtin_memcpy constexpr evaluation to use the same infrastructure. rdar://44987528 Differential revision: https://reviews.llvm.org/D62825 llvm-svn: 364954 --- clang/lib/Edit/RewriteObjCFoundationAPI.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Edit') diff --git a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp index 4dfe170ed62..6f4a880b649 100644 --- a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp +++ b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp @@ -1042,6 +1042,7 @@ static bool rewriteToNumericBoxedExpression(const ObjCMessageExpr *Msg, case CK_Dependent: case CK_BitCast: case CK_LValueBitCast: + case CK_LValueToRValueBitCast: case CK_BaseToDerived: case CK_DerivedToBase: case CK_UncheckedDerivedToBase: -- cgit v1.2.3