diff options
author | Richard Trieu <rtrieu@google.com> | 2014-06-09 22:53:25 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-06-09 22:53:25 +0000 |
commit | ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d (patch) | |
tree | 37c95111a4e9ec687e3be04eb7f4e149d693c0e2 /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | a23043cb9c1ef021a9cf05cd62cce76cd03c0ba2 (diff) | |
download | bcm5719-llvm-ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d.tar.gz bcm5719-llvm-ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d.zip |
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.
llvm-svn: 210498
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 24d82224ddf..6eccb9f85dc 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -283,6 +283,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { case EST_ComputedNoexcept: OS << "noexcept("; + assert(OldProto->getNoexceptExpr() != nullptr && "Expected non-null Expr"); OldProto->getNoexceptExpr()->printPretty(OS, nullptr, getPrintingPolicy()); OS << ")"; break; |