Skip to content

Commit e9ea0be

Browse files
committed
Include sources can decay to pointer type
1 parent f99d61e commit e9ea0be

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11695,13 +11695,11 @@ void Sema::CheckImplicitConversion(Expr *E, QualType T, SourceLocation CC,
1169511695
diag::warn_impcast_objective_c_literal_to_bool);
1169611696
}
1169711697
if (Source->isPointerType() || Source->canDecayToPointerType()) {
11698+
Diag(E->getExprLoc(), diag::warn_impcast_pointer_to_bool_strict);
1169811699
// Warn on pointer to bool conversion that is always true.
1169911700
DiagnoseAlwaysNonNullPointer(E, Expr::NPCK_NotNull, /*IsEqual*/ false,
1170011701
SourceRange(CC));
1170111702
}
11702-
if (Source->isPointerType()) {
11703-
Diag(E->getExprLoc(), diag::warn_impcast_pointer_to_bool_strict);
11704-
}
1170511703
}
1170611704

1170711705
// If the we're converting a constant to an ObjC BOOL on a platform where BOOL

0 commit comments

Comments
 (0)