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 | fcd78b02c213d6e436f53fa5ef830e28189db900 (patch) | |
tree | 9b24d8e0a02c1c01173a2f608522d57bb6f61282 /clang/lib | |
parent | a0a58b63f748c98ced1afc936e025289b6c1902f (diff) | |
download | bcm5719-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.cpp | 7 |
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!"); |