Skip to content

Commit 303a982

Browse files
committed
[clang] Formatted
1 parent 419fb2a commit 303a982

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,11 @@ class Expr : public ValueStmt {
451451
return (OK == OK_Ordinary || OK == OK_BitField);
452452
}
453453

454-
bool isInsideCondition() const {
455-
return IsInsideCondition;
456-
}
454+
bool isInsideCondition() const { return IsInsideCondition; }
457455

458456
/// setValueKind - Mark this expression to be inside a condition.
459457
/// necessary for `warn_assignment_bool_context` diagnostic
460-
void setIsInsideCondition() {
461-
IsInsideCondition = true;
462-
}
458+
void setIsInsideCondition() { IsInsideCondition = true; }
463459

464460
/// setValueKind - Set the value kind produced by this expression.
465461
void setValueKind(ExprValueKind Cat) { ExprBits.ValueKind = Cat; }

clang/lib/Sema/Sema.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ void Sema::DiagnoseAssignmentBoolContext(Expr *E, QualType Ty) {
703703
E = ICE->getSubExpr();
704704
}
705705

706-
// Condition-assignment warnings are already handled by `DiagnoseAssignmentAsCondition()`
706+
// Condition-assignment warnings are already handled by
707+
// `DiagnoseAssignmentAsCondition()`
707708
if (E->isInsideCondition())
708709
return;
709710

@@ -714,8 +715,7 @@ void Sema::DiagnoseAssignmentBoolContext(Expr *E, QualType Ty) {
714715
// only does for regular assignment.
715716
if (Op->getOpcode() == BO_Assign) {
716717
SourceLocation Loc = Op->getOperatorLoc();
717-
Diag(Loc, diag::warn_assignment_bool_context)
718-
<< E->getSourceRange();
718+
Diag(Loc, diag::warn_assignment_bool_context) << E->getSourceRange();
719719

720720
SourceLocation Open = E->getBeginLoc();
721721
SourceLocation Close =

0 commit comments

Comments
 (0)