[PR41567][Sema] Fixed cast kind in addr space conversions
This change sets missing cast kind correctly in the address
space conversion case.
Differential Revision: https://reviews.llvm.org/D62299
llvm-svn: 362409
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp
index 0958943..46d0f57 100644
--- a/clang/lib/Sema/SemaCast.cpp
+++ b/clang/lib/Sema/SemaCast.cpp
@@ -2450,6 +2450,10 @@
tcr = TryAddressSpaceCast(Self, SrcExpr, DestType, /*CStyle*/ true, msg);
if (SrcExpr.isInvalid())
return;
+
+ if (isValidCast(tcr))
+ Kind = CK_AddressSpaceConversion;
+
if (tcr == TC_NotApplicable) {
// ... or if that is not possible, a static_cast, ignoring const, ...
tcr = TryStaticCast(Self, SrcExpr, DestType, CCK, OpRange, msg, Kind,