diff options
author | Sam Bishop <sam@bishop.dhs.org> | 2008-04-13 04:32:18 +0000 |
---|---|---|
committer | Sam Bishop <sam@bishop.dhs.org> | 2008-04-13 04:32:18 +0000 |
commit | 1b30cb27f894687c6021e7331265ae21aeb57d3f (patch) | |
tree | 269be1a3272c34d64542b70252b02ca5c4917946 /lib/AST/Decl.cpp | |
parent | 9e979557eea3875c9e3d100c68188233dd7f46c0 (diff) |
Use static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index bcb117dbc6..ac1a593e6f 100644 --- a/lib/AST/Decl.cpp +++ b/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!"); |