]> granicus.if.org Git - clang/commitdiff
Revert r348830 "[Sema]improve static_assert(!expr)"
authorClement Courbet <courbet@google.com>
Tue, 11 Dec 2018 07:28:00 +0000 (07:28 +0000)
committerClement Courbet <courbet@google.com>
Tue, 11 Dec 2018 07:28:00 +0000 (07:28 +0000)
Submitted the wrong change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348831 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp
test/SemaCXX/static-assert.cpp

index cb6e32fc5e581f7152c8b7a474961eef7280ffd1..56302d624844c811679e900def113fd8db17312f 100644 (file)
@@ -3071,20 +3071,6 @@ static void prettyPrintFailedBooleanCondition(llvm::raw_string_ostream &OS,
     }
     return;
   }
-  if (const auto *Paren = dyn_cast<ParenExpr>(FailedCond)) {
-    OS << "(";
-    prettyPrintFailedBooleanCondition(OS, Paren->getSubExpr(), Policy);
-    OS << ")";
-    return;
-  }
-  // If this is !(BooleanExpression), try pretty-printing the inner expression.
-  const auto *UnaryOp = dyn_cast<UnaryOperator>(FailedCond);
-  if (UnaryOp && UnaryOp->getOpcode() == UO_LNot) {
-    OS << "!";
-    prettyPrintFailedBooleanCondition(OS, UnaryOp->getSubExpr(), Policy);
-    return;
-  }
-
   FailedCond->printPretty(OS, nullptr, Policy);
 }
 
index 8c666b0dd9063f4cfe602cb16ec1d2c13b0d58ba..38f82091ae7839f13bfb7e0d7519aa70bb012763 100644 (file)
@@ -111,10 +111,6 @@ static_assert(std::is_same<ExampleTypes::T, ExampleTypes::U>::value, "message");
 // expected-error@-1{{static_assert failed due to requirement 'std::is_same<int, float>::value' "message"}}
 static_assert(std::is_const<ExampleTypes::T>::value, "message");
 // expected-error@-1{{static_assert failed due to requirement 'std::is_const<int>::value' "message"}}
-static_assert(!std::is_const<const ExampleTypes::T>::value, "message");
-// expected-error@-1{{static_assert failed due to requirement '!std::is_const<int>::value' "message"}}
-static_assert(!(std::is_const<const ExampleTypes::T>::value), "message");
-// expected-error@-1{{static_assert failed due to requirement '!(std::is_const<int>::value)' "message"}}
 
 struct BI_tag {};
 struct RAI_tag : BI_tag {};