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; + // Ignore BO_LOr operators at the toplevel. + if (Op->getOpcode() == BO_LOr) + 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 @@ -258,9 +258,17 @@ constexpr bool invert(bool b) { return !b; } + + /// Bools are printed with disjunction. + static_assert(invert(true) || invert(true), ""); // expected-error {{failed}} \ + + /// Bools are printed with an expected note. static_assert(invert(true) == invert(false), ""); // expected-error {{failed}} \ // expected-note {{evaluates to 'false == true'}} + /// Bools are printed with conjunction. + static_assert(true && false, ""); // expected-error {{failed}} \ + /// No notes here since we compare a bool expression with a bool literal. static_assert(invert(true) == true, ""); // expected-error {{failed}}