[llvm-branch-commits] [cfe-branch] r195139 - Merging r195126:

Bill Wendling isanbard at gmail.com
Tue Nov 19 10:41:12 PST 2013


Author: void
Date: Tue Nov 19 12:41:11 2013
New Revision: 195139

URL: http://llvm.org/viewvc/llvm-project?rev=195139&view=rev
Log:
Merging r195126:
------------------------------------------------------------------------
r195126 | joerg | 2013-11-19 05:38:38 -0800 (Tue, 19 Nov 2013) | 2 lines

Revert r194540, it breaks various C++ programs.

------------------------------------------------------------------------

Removed:
    cfe/branches/release_34/test/Sema/warn-null.c
Modified:
    cfe/branches/release_34/   (props changed)
    cfe/branches/release_34/lib/Sema/SemaExpr.cpp

Propchange: cfe/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 19 12:41:11 2013
@@ -1,3 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
+/cfe/trunk:195126
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_34/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Sema/SemaExpr.cpp?rev=195139&r1=195138&r2=195139&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/release_34/lib/Sema/SemaExpr.cpp Tue Nov 19 12:41:11 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/branches/release_34/test/Sema/warn-null.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/test/Sema/warn-null.c?rev=195138&view=auto
==============================================================================
--- cfe/branches/release_34/test/Sema/warn-null.c (original)
+++ cfe/branches/release_34/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}}





More information about the llvm-branch-commits mailing list