]> granicus.if.org Git - clang/commitdiff
Disable questionable code for handling isNullPointerConstant on value dependent
authorDaniel Dunbar <daniel@zuster.org>
Fri, 18 Sep 2009 08:46:16 +0000 (08:46 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 18 Sep 2009 08:46:16 +0000 (08:46 +0000)
expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82217 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp
test/SemaCXX/value-dependent-exprs.cpp

index d7565c7bbef0d2ce1d74cd20e2e550a07f9ceabe..60458b4fb6ec8941f882440496645bf120adc7ba 100644 (file)
@@ -1627,8 +1627,8 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
 /// cast to void*.
 bool Expr::isNullPointerConstant(ASTContext &Ctx) const {
   // Ignore value dependent expressions.
-  if (isValueDependent())
-    return true;
+  assert(!isValueDependent() && "Unexpect value dependent expression!");
+
   // Strip off a cast to void*, if it exists. Except in C++.
   if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) {
     if (!Ctx.getLangOptions().CPlusPlus) {
index 603da9b38e91858c1c143f4e25512fc6934a3d11..c70f895d2bf94ab77a9f55a653cb844b3ff0a717 100644 (file)
@@ -14,10 +14,13 @@ class C0 {
     int b[I];
   };
 
+  // FIXME: I'm unclear where the right place to handle this is.
+#if 0
   void f0(int *p) {
     if (p == I) {
     }
   }
+#endif
 
 #if 0
   // FIXME: Not sure whether we care about these.