summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSam Bishop <sam@bishop.dhs.org>2008-04-13 04:32:18 +0000
committerSam Bishop <sam@bishop.dhs.org>2008-04-13 04:32:18 +0000
commitfcd78b02c213d6e436f53fa5ef830e28189db900 (patch)
tree9b24d8e0a02c1c01173a2f608522d57bb6f61282 /clang/lib
parenta0a58b63f748c98ced1afc936e025289b6c1902f (diff)
downloadbcm5719-llvm-fcd78b02c213d6e436f53fa5ef830e28189db900.tar.gz
bcm5719-llvm-fcd78b02c213d6e436f53fa5ef830e28189db900.zip
Use static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
Kirtzidis! llvm-svn: 49603
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Decl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index bcb117dbc65..ac1a593e6f9 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -329,7 +329,10 @@ const Attr *Decl::getAttrs() const {
return (*DeclAttrs)[this];
}
-#define CASE(KIND) case KIND: cast<KIND##Decl>(this)->~KIND##Decl(); break
+#define CASE(KIND) \
+ case KIND: \
+ static_cast<KIND##Decl *>(const_cast<Decl *>(this))->~KIND##Decl(); \
+ break
void Decl::Destroy(ASTContext& C) const {
switch (getKind()) {
@@ -355,7 +358,7 @@ void Decl::Destroy(ASTContext& C) const {
CASE(LinkageSpec);
case Struct: case Union: case Class:
- cast<RecordDecl>(this)->~RecordDecl();
+ static_cast<RecordDecl *>(const_cast<Decl *>(this))->~RecordDecl();
break;
default: assert(0 && "Unknown decl kind!");
OpenPOWER on IntegriCloud