aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-03-14 11:17:20 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-03-14 11:17:20 +0000
commit8f0d1f053f3acadec28a2b1c0b6a714ad5a12aab (patch)
tree5b78d2cf413356fe4385a05a75c4b8a303de08d1
parentd3cf17b5f1fed43dbd0cd35c43d15139803c9c84 (diff)
Fix an unused variable warning from Clang by sinking a dyn_cast into an
isa and a cast inside the assert. The efficiency concern isn't really important here. The code should likely be cleaned up a bit more, especially getting a message into the assert. Please review Rafael. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177053 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/Decl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 64059a6358..b18a0a8f1a 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -3299,8 +3299,8 @@ void Redeclarable<decl_type>::setPreviousDeclaration(decl_type *PrevDecl) {
// First one will point to this one as latest.
First->RedeclLink = LatestDeclLink(static_cast<decl_type*>(this));
- if (NamedDecl *ND = dyn_cast<NamedDecl>(static_cast<decl_type*>(this)))
- assert(ND->isLinkageValid());
+ assert(!isa<NamedDecl>(static_cast<decl_type*>(this)) ||
+ cast<NamedDecl>(static_cast<decl_type*>(this))->isLinkageValid());
}
// Inline function definitions.