Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaExpr.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 12,705 Lines • ▼ Show 20 Lines | if (!IsOrdered && LHSIsNull != RHSIsNull) { | ||||
if (RHSIsNull) | if (RHSIsNull) | ||||
DiagnoseAlwaysNonNullPointer(LHS.get(), RHSNullKind, IsEquality, | DiagnoseAlwaysNonNullPointer(LHS.get(), RHSNullKind, IsEquality, | ||||
RHS.get()->getSourceRange()); | RHS.get()->getSourceRange()); | ||||
else | else | ||||
DiagnoseAlwaysNonNullPointer(RHS.get(), LHSNullKind, IsEquality, | DiagnoseAlwaysNonNullPointer(RHS.get(), LHSNullKind, IsEquality, | ||||
LHS.get()->getSourceRange()); | LHS.get()->getSourceRange()); | ||||
} | } | ||||
if (!IsOrdered && LHSType->isFunctionPointerType() && | |||||
RHSType->isFunctionPointerType() && !LHSIsNull && !RHSIsNull) | |||||
cjdb: Braces sadly need to go, as this is a one-line statement. | |||||
Diag(Loc, diag::warn_typecheck_comparison_of_function_pointers) | |||||
<< LHSType << RHSType | |||||
<< LHS.get()->getSourceRange() << RHS.get()->getSourceRange(); | |||||
if (IsOrdered && LHSType->isFunctionPointerType() && | if (IsOrdered && LHSType->isFunctionPointerType() && | ||||
RHSType->isFunctionPointerType()) { | RHSType->isFunctionPointerType()) { | ||||
// Valid unless a relational comparison of function pointers | // Valid unless a relational comparison of function pointers | ||||
bool IsError = Opc == BO_Cmp; | bool IsError = Opc == BO_Cmp; | ||||
auto DiagID = | auto DiagID = | ||||
IsError ? diag::err_typecheck_ordered_comparison_of_function_pointers | IsError ? diag::err_typecheck_ordered_comparison_of_function_pointers | ||||
: getLangOpts().CPlusPlus | : getLangOpts().CPlusPlus | ||||
? diag::warn_typecheck_ordered_comparison_of_function_pointers | ? diag::warn_typecheck_ordered_comparison_of_function_pointers | ||||
▲ Show 20 Lines • Show All 8,450 Lines • Show Last 20 Lines |
Braces sadly need to go, as this is a one-line statement.