summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-06-09 22:53:25 +0000
committerRichard Trieu <rtrieu@google.com>2014-06-09 22:53:25 +0000
commit8a8409652339fa1ee1446b12b75a29e808cd8816 (patch)
tree02d381a96820cd2a803ad4baa3a79aad55ae2646 /unittests
parent38d0c47ac00718bc55655b6e9cbc9029c0b458b3 (diff)
downloadclang-8a8409652339fa1ee1446b12b75a29e808cd8816.tar.gz
clang-8a8409652339fa1ee1446b12b75a29e808cd8816.tar.bz2
clang-8a8409652339fa1ee1446b12b75a29e808cd8816.tar.xz
Removing an "if (this == nullptr)" check from two print methods. The condition
will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/AST/StmtPrinterTest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/unittests/AST/StmtPrinterTest.cpp b/unittests/AST/StmtPrinterTest.cpp
index 0b334e768f..c75cbdefbf 100644
--- a/unittests/AST/StmtPrinterTest.cpp
+++ b/unittests/AST/StmtPrinterTest.cpp
@@ -32,6 +32,7 @@ using namespace tooling;
namespace {
void PrintStmt(raw_ostream &Out, const ASTContext *Context, const Stmt *S) {
+ assert(S != nullptr && "Expected non-null Stmt");
PrintingPolicy Policy = Context->getPrintingPolicy();
S->printPretty(Out, /*Helper*/ nullptr, Policy);
}