diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-06-03 15:42:36 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-06-03 15:42:36 +0000 |
commit | 5099aef86964c4b845d9165b9328e6e8e30fc8a3 (patch) | |
tree | f2fc5ed0b2994b439766c7eda9029848f6368c57 /clang/lib/Sema/SemaCast.cpp | |
parent | bedcaea99a78d869b0c2763c6c2f471b5637fc35 (diff) | |
download | bcm5719-llvm-5099aef86964c4b845d9165b9328e6e8e30fc8a3.tar.gz bcm5719-llvm-5099aef86964c4b845d9165b9328e6e8e30fc8a3.zip |
[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
Diffstat (limited to 'clang/lib/Sema/SemaCast.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCast.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 0958943f9ef..46d0f57dc77 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -2450,6 +2450,10 @@ void CastOperation::CheckCXXCStyleCast(bool FunctionalStyle, 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, |