<p dir="ltr">Please pull this change onto the release branch. Thanks!</p>
<div class="gmail_quote">On 19 Nov 2013 05:44, "Joerg Sonnenberger" <<a href="mailto:joerg@bec.de">joerg@bec.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: joerg<br>
Date: Tue Nov 19 07:38:38 2013<br>
New Revision: 195126<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=195126&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=195126&view=rev</a><br>
Log:<br>
Revert r194540, it breaks various C++ programs.<br>
<br>
Removed:<br>
cfe/trunk/test/Sema/warn-null.c<br>
Modified:<br>
cfe/trunk/lib/Sema/SemaExpr.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=195126&r1=195125&r2=195126&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=195126&r1=195125&r2=195126&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Nov 19 07:38:38 2013<br>
@@ -10619,17 +10619,8 @@ bool Sema::DiagnoseAssignmentResult(Assi<br>
<br>
switch (ConvTy) {<br>
case Compatible:<br>
- // See if a proper null pointer constant is to be assigned.<br>
- if (DstType->isAnyPointerType() && !SrcType->isAnyPointerType() &&<br>
- SrcExpr->isNullPointerConstant(Context,<br>
- Expr::NPC_NeverValueDependent) ==<br>
- Expr::NPCK_ZeroExpression &&<br>
- !isUnevaluatedContext())<br>
- Diag(SrcExpr->getExprLoc(), diag::warn_non_literal_null_pointer)<br>
- << DstType << SrcExpr->getSourceRange();<br>
-<br>
- DiagnoseAssignmentEnum(DstType, SrcType, SrcExpr);<br>
- return false;<br>
+ DiagnoseAssignmentEnum(DstType, SrcType, SrcExpr);<br>
+ return false;<br>
<br>
case PointerToInt:<br>
DiagKind = diag::ext_typecheck_convert_pointer_int;<br>
<br>
Removed: cfe/trunk/test/Sema/warn-null.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-null.c?rev=195125&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-null.c?rev=195125&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Sema/warn-null.c (original)<br>
+++ cfe/trunk/test/Sema/warn-null.c (removed)<br>
@@ -1,6 +0,0 @@<br>
-// RUN: %clang_cc1 %s -verify -fsyntax-only<br>
-<br>
-// PR10837: warn if a non-pointer-typed expression is folded to a null pointer<br>
-int *p = 0;<br>
-int *q = '\0'; // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}<br>
-int *r = (1 - 1); // expected-warning{{expression which evaluates to zero treated as a null pointer constant}}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>