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 @@ -16725,7 +16725,7 @@ return; // Don't print obvious expressions. - if (!UsefulToPrintExpr(LHS) && !UsefulToPrintExpr(RHS)) + if ((!UsefulToPrintExpr(LHS) && !UsefulToPrintExpr(RHS)) || Op->getOpcode() == BO_LOr) return; struct { 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,14 @@ constexpr bool invert(bool b) { return !b; } + + static_assert(invert(true) || invert(true), ""); // expected-error {{failed}} + static_assert(invert(true) == invert(false), ""); // expected-error {{failed}} \ // expected-note {{evaluates to 'false == true'}} + 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}}