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/SemaDeclCXX.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/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 3f8034a49ff..3b660fdd423 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -11407,6 +11407,8 @@ Decl *Sema::BuildStaticAssertDeclaration(SourceLocation StaticAssertLoc, StringLiteral *AssertMessage, SourceLocation RParenLoc, bool Failed) { + assert(AssertExpr != nullptr && AssertMessage != nullptr && + "Expected non-null Expr's"); if (!AssertExpr->isTypeDependent() && !AssertExpr->isValueDependent() && !Failed) { // In a static_assert-declaration, the constant-expression shall be a |

