From: Clement Courbet Date: Tue, 11 Dec 2018 07:28:00 +0000 (+0000) Subject: Revert r348830 "[Sema]improve static_assert(!expr)" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90d955a050780c8c1824a2f3219e2e3856dd848b;p=clang Revert r348830 "[Sema]improve static_assert(!expr)" Submitted the wrong change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348831 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index cb6e32fc5e..56302d6248 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -3071,20 +3071,6 @@ static void prettyPrintFailedBooleanCondition(llvm::raw_string_ostream &OS, } return; } - if (const auto *Paren = dyn_cast(FailedCond)) { - OS << "("; - prettyPrintFailedBooleanCondition(OS, Paren->getSubExpr(), Policy); - OS << ")"; - return; - } - // If this is !(BooleanExpression), try pretty-printing the inner expression. - const auto *UnaryOp = dyn_cast(FailedCond); - if (UnaryOp && UnaryOp->getOpcode() == UO_LNot) { - OS << "!"; - prettyPrintFailedBooleanCondition(OS, UnaryOp->getSubExpr(), Policy); - return; - } - FailedCond->printPretty(OS, nullptr, Policy); } diff --git a/test/SemaCXX/static-assert.cpp b/test/SemaCXX/static-assert.cpp index 8c666b0dd9..38f82091ae 100644 --- a/test/SemaCXX/static-assert.cpp +++ b/test/SemaCXX/static-assert.cpp @@ -111,10 +111,6 @@ static_assert(std::is_same::value, "message"); // expected-error@-1{{static_assert failed due to requirement 'std::is_same::value' "message"}} static_assert(std::is_const::value, "message"); // expected-error@-1{{static_assert failed due to requirement 'std::is_const::value' "message"}} -static_assert(!std::is_const::value, "message"); -// expected-error@-1{{static_assert failed due to requirement '!std::is_const::value' "message"}} -static_assert(!(std::is_const::value), "message"); -// expected-error@-1{{static_assert failed due to requirement '!(std::is_const::value)' "message"}} struct BI_tag {}; struct RAI_tag : BI_tag {};