[cfe-commits] r51276 - in /cfe/trunk: lib/AST/Expr.cpptest/Sema/unused-expr.c

Nuno Lopes nunoplopes at sapo.pt
Mon May 19 14:37:51 PDT 2008


Ah, thank you!
clang was really producing hundreds of that warning in PHP, which was quite 
annoying.

BTW, clang is almost able to compile PHP :)  (all problems are reported in 
the bug tracker already).

Nuno


----- Original Message ----- 
From: "Eli Friedman" <eli.friedman at gmail.com>
To: <cfe-commits at cs.uiuc.edu>
Sent: Monday, May 19, 2008 10:24 PM
Subject: [cfe-commits] r51276 - in /cfe/trunk: 
lib/AST/Expr.cpptest/Sema/unused-expr.c


> Author: efriedma
> Date: Mon May 19 16:24:43 2008
> New Revision: 51276
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51276&view=rev
> Log:
> Make the unused expression warning a bit less aggressive (found in PHP
> code).
>
>
> Modified:
>    cfe/trunk/lib/AST/Expr.cpp
>    cfe/trunk/test/Sema/unused-expr.c
>
> Modified: cfe/trunk/lib/AST/Expr.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=51276&r1=51275&r2=51276&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/AST/Expr.cpp (original)
> +++ cfe/trunk/lib/AST/Expr.cpp Mon May 19 16:24:43 2008
> @@ -336,6 +336,10 @@
>       return cast<CastExpr>(this)->getSubExpr()->hasLocalSideEffect();
>     return false;
>
> +  case ImplicitCastExprClass:
> +    // Check the operand, since implicit casts are inserted by Sema
> +    return 
> cast<ImplicitCastExpr>(this)->getSubExpr()->hasLocalSideEffect();
> +
>   case CXXDefaultArgExprClass:
>     return cast<CXXDefaultArgExpr>(this)->getExpr()->hasLocalSideEffect();
>   }
>
> Modified: cfe/trunk/test/Sema/unused-expr.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/unused-expr.c?rev=51276&r1=51275&r2=51276&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Sema/unused-expr.c (original)
> +++ cfe/trunk/test/Sema/unused-expr.c Mon May 19 16:24:43 2008
> @@ -35,3 +35,8 @@
>   return ({int _a = x, _b = y; _a > _b ? _a : _b; });
> }
>
> +void nowarn(unsigned char* a, unsigned char* b)
> +{
> +  unsigned char c = 1;
> +  *a |= c, *b += c;
> +}
>
>
> _______________________________________________
> 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