================
Comment at: lib/AST/Decl.cpp:2512-2514
@@ -2511,5 +2511,5 @@
const FunctionType *FT = getType()->castAs<FunctionType>();
- if (isa<FunctionNoProtoType>(FT))
+ if (FT->getAs<FunctionNoProtoType>())
return 0;
- return cast<FunctionProtoType>(FT)->getNumArgs();
+ return FT->castAs<FunctionProtoType>()->getNumArgs();
----------------
Richard Smith wrote:
> The pre-existing `isa<...>` check here looks correct to me; what's this
> change for?
>
> If anything, we should rewrite this as
>
> const FunctionProtoType *FPT = getType()->getAs<FunctionProtoType>();
> return FPT ? FPT->getNumArgs() : 0;
Yeah, this wasn't necessary. I was debugging crashes here and I forgot to
revert this because putting back the isa<> and cast<> seemed suspicious. I'll
commit your suggested rewrite.
http://llvm-reviews.chandlerc.com/D2332
BRANCH
fix-memptr-cc
ARCANIST PROJECT
clang
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits