[cfe-commits] r140388 - /cfe/trunk/lib/Serialization/ASTReaderStmt.cpp

Ahmed Charles ahmedcharles at gmail.com
Fri Sep 23 12:50:02 PDT 2011


I was curious about this warning/code. Is Record[Idx] always going to
be 0/1 (false/true) in this code path? If so, wouldn't the appropriate
cast be casting Record[Idx] to bool?

On Fri, Sep 23, 2011 at 9:57 AM, Douglas Gregor <dgregor at apple.com> wrote:
> Author: dgregor
> Date: Fri Sep 23 11:57:55 2011
> New Revision: 140388
>
> URL: http://llvm.org/viewvc/llvm-project?rev=140388&view=rev
> Log:
> Eliminate an MSVC comparison warning, from Aaron Ballman
>
> Modified:
>    cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
>
> Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=140388&r1=140387&r2=140388&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Fri Sep 23 11:57:55 2011
> @@ -1061,7 +1061,7 @@
>  void ASTStmtReader::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
>   VisitExpr(E);
>
> -  assert(Record[Idx] == E->Param.getInt() && "We messed up at creation ?");
> +  assert(Record[Idx] == (unsigned)E->Param.getInt() && "We messed up at creation ?");
>   ++Idx; // HasOtherExprStored and SubExpr was handled during creation.
>   E->Param.setPointer(ReadDeclAs<ParmVarDecl>(Record, Idx));
>   E->Loc = ReadSourceLocation(Record, Idx);
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



-- 
Ahmed Charles
http://www.ahmedcharles.com




More information about the cfe-commits mailing list