[cfe-commits] r54525 - /cfe/trunk/include/clang/AST/DeclCXX.h
Chris Lattner
clattner at apple.com
Fri Aug 8 08:32:59 PDT 2008
On Aug 8, 2008, at 6:26 AM, Argiris Kirtzidis wrote:
> Author: akirtzidis
> Date: Fri Aug 8 08:26:45 2008
> New Revision: 54525
>
> URL: http://llvm.org/viewvc/llvm-project?rev=54525&view=rev
> Log:
> Use static_cast<> instead of cast<> for CXXFieldDecl::getMember().
Why? cast<> does the assertion internally, implicitly.
-Chris
>
>
> Modified:
> cfe/trunk/include/clang/AST/DeclCXX.h
>
> Modified: cfe/trunk/include/clang/AST/DeclCXX.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=54525&r1=54524&r2=54525&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/include/clang/AST/DeclCXX.h (original)
> +++ cfe/trunk/include/clang/AST/DeclCXX.h Fri Aug 8 08:26:45 2008
> @@ -54,10 +54,12 @@
> ScopedDecl *PrevDecl);
>
> const CXXFieldDecl *getMember(unsigned i) const {
> - return cast<const CXXFieldDecl>(RecordDecl::getMember(i));
> + assert(isa<CXXFieldDecl>(RecordDecl::getMember(i)));
> + return static_cast<const
> CXXFieldDecl*>(RecordDecl::getMember(i));
> }
> CXXFieldDecl *getMember(unsigned i) {
> - return cast<CXXFieldDecl>(RecordDecl::getMember(i));
> + assert(isa<CXXFieldDecl>(RecordDecl::getMember(i)));
> + return static_cast<CXXFieldDecl*>(RecordDecl::getMember(i));
> }
>
> /// getMember - If the member doesn't exist, or there are no
> members, this
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list