r195126 - Revert r194540, it breaks various C++ programs.
Richard Smith
richard at metafoo.co.uk
Tue Nov 19 11:02:17 PST 2013
Please pull this change onto the release branch. Thanks!
On 19 Nov 2013 05:44, "Joerg Sonnenberger" <joerg at bec.de> wrote:
> Author: joerg
> Date: Tue Nov 19 07:38:38 2013
> New Revision: 195126
>
> URL: http://llvm.org/viewvc/llvm-project?rev=195126&view=rev
> Log:
> Revert r194540, it breaks various C++ programs.
>
> Removed:
> cfe/trunk/test/Sema/warn-null.c
> Modified:
> cfe/trunk/lib/Sema/SemaExpr.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=195126&r1=195125&r2=195126&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Nov 19 07:38:38 2013
> @@ -10619,17 +10619,8 @@ bool Sema::DiagnoseAssignmentResult(Assi
>
> switch (ConvTy) {
> case Compatible:
> - // See if a proper null pointer constant is to be assigned.
> - if (DstType->isAnyPointerType() && !SrcType->isAnyPointerType() &&
> - SrcExpr->isNullPointerConstant(Context,
> - Expr::NPC_NeverValueDependent) ==
> - Expr::NPCK_ZeroExpression &&
> - !isUnevaluatedContext())
> - Diag(SrcExpr->getExprLoc(), diag::warn_non_literal_null_pointer)
> - << DstType << SrcExpr->getSourceRange();
> -
> - DiagnoseAssignmentEnum(DstType, SrcType, SrcExpr);
> - return false;
> + DiagnoseAssignmentEnum(DstType, SrcType, SrcExpr);
> + return false;
>
> case PointerToInt:
> DiagKind = diag::ext_typecheck_convert_pointer_int;
>
> Removed: cfe/trunk/test/Sema/warn-null.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-null.c?rev=195125&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/Sema/warn-null.c (original)
> +++ cfe/trunk/test/Sema/warn-null.c (removed)
> @@ -1,6 +0,0 @@
> -// RUN: %clang_cc1 %s -verify -fsyntax-only
> -
> -// PR10837: warn if a non-pointer-typed expression is folded to a null
> pointer
> -int *p = 0;
> -int *q = '\0'; // expected-warning{{expression which evaluates to zero
> treated as a null pointer constant}}
> -int *r = (1 - 1); // expected-warning{{expression which evaluates to
> zero treated as a null pointer constant}}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131119/80263e0f/attachment.html>
More information about the cfe-commits
mailing list