Skip to content

Commit

Permalink
Fix spurious warning about cast of unrelated types
Browse files Browse the repository at this point in the history
  • Loading branch information
DutChen18 authored and yuri91 committed Jul 1, 2024
1 parent bd1858b commit 910a8a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ Address CodeGenFunction::EmitPointerWithAlignment(const Expr *E,
*TBAAInfo = CGM.mergeTBAAInfoForCast(*TBAAInfo,
TargetTypeTBAAInfo);
const ExplicitCastExpr *ECE = cast<ExplicitCastExpr>(CE);
if ((CGM.getTarget().isByteAddressable()==false) && ECE->getSubExpr()->getType() != ECE->getType()) {
if ((CGM.getTarget().isByteAddressable()==false) && !getContext().hasSameType(ECE->getSubExpr()->getType(), ECE->getType())) {
bool asmjs = CurFn->getSection()==StringRef("asmjs");
llvm::Function* intrinsic = CGM.GetUserCastIntrinsic(ECE,
ECE->getSubExpr()->getType(),
Expand Down

0 comments on commit 910a8a2

Please sign in to comment.