On Tue, Feb 7, 2017 at 1:09 PM, Jonathan Roelofs <jonat...@codesourcery.com>
wrote:

>
>
> On 1/24/17 8:10 PM, Saleem Abdulrasool via cfe-commits wrote:
>
>> Don't use the cast for the check, use isa.  Although, since you use the
>> value later, it is probably better to write this as:
>>
>>     if (const auto *RD = cast<CXXRecordDecl>(CurContext))
>>       CheckShadowInheritedVariabless(Loc, Name.getAsString(), RD, RD);
>>
>
>
> @compnerd: s/cast/dyn_cast/ or s/cast/dyn_cast_or_null/, right?
>

Only in that it looks weird.  There is an assert that CurContext is a
CXXRecordDecl, so the cast is perfectly fine.


>
> Jon
>
>
> --
> Jon Roelofs
> jonat...@codesourcery.com
> CodeSourcery / Mentor Embedded
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to