summaryrefslogtreecommitdiffstats
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
commit5aa9d793c5a878bab4552fa24b11f742404b4272 (patch)
tree545023f41ff05b0d5ac633f14c1d52fdcc4e5a0d
parentead6cf7c729693451a19983ac165126f807a83d6 (diff)
downloadbcm5719-llvm-5aa9d793c5a878bab4552fa24b11f742404b4272.tar.gz
bcm5719-llvm-5aa9d793c5a878bab4552fa24b11f742404b4272.zip
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. llvm-svn: 177053
-rw-r--r--clang/include/clang/AST/Decl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 64059a63587..b18a0a8f1a7 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/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.
OpenPOWER on IntegriCloud