diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -16728,6 +16728,10 @@ if (!UsefulToPrintExpr(LHS) && !UsefulToPrintExpr(RHS)) return; + // Don't print obvious boolean literals. + if (LHS->getType()->isBooleanType() && RHS->getType()->isBooleanType()) + return; + struct { const clang::Expr *Cond; Expr::EvalResult Result; diff --git a/clang/test/SemaCXX/static-assert.cpp b/clang/test/SemaCXX/static-assert.cpp --- a/clang/test/SemaCXX/static-assert.cpp +++ b/clang/test/SemaCXX/static-assert.cpp @@ -259,7 +259,6 @@ return !b; } static_assert(invert(true) == invert(false), ""); // expected-error {{failed}} \ - // expected-note {{evaluates to 'false == true'}} /// No notes here since we compare a bool expression with a bool literal. static_assert(invert(true) == true, ""); // expected-error {{failed}}