lebedev.ri added inline comments.
================
Comment at: lib/Sema/SemaCast.cpp:97
while ((CE = dyn_cast<ImplicitCastExpr>(CE->getSubExpr())))
- CE->setIsPartOfExplicitCast(true);
+ dyn_cast<ImplicitCastExpr>(CE)->setIsPartOfExplicitCast(true);
}
----------------
lebedev.ri wrote:
> erichkeane wrote:
> > I think I'd prefer just using a different variable in the 'while' loop to
> > avoid the cast. something like while((auto ICE =....
> >
> > That said, either way this isn't a dyn_cast, this would be just a cast
> > (since we KNOW the type).
> I was trying to avoid having one extra variable, which may confuse things.
> Let's see maybe it's not that ugly..
Indeed, `cast<>` should be used.
But trying to avoid this cast at all results in uglier code, so let's not.
(I need to call `getSubExpr()` on this new `ImplicitCastExpr`, so i'd need to
maintain two variables, etc...)
Repository:
rC Clang
https://reviews.llvm.org/D49838
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits