[cfe-commits] r47069 - in /cfe/trunk: AST/Expr.cpp test/Sema/conditional-expr.c

Eli Friedman eli.friedman at gmail.com
Wed Feb 13 09:29:58 PST 2008


Author: efriedma
Date: Wed Feb 13 11:29:58 2008
New Revision: 47069

URL: http://llvm.org/viewvc/llvm-project?rev=47069&view=rev
Log:
Fix a minor bug in isNullPointerConstant triggered by the linux 
tgmath.h.

Note that there is another issue with tgmath.h, so mandel.c still 
doesn't work.


Modified:
    cfe/trunk/AST/Expr.cpp
    cfe/trunk/test/Sema/conditional-expr.c

Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=47069&r1=47068&r2=47069&view=diff

==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Wed Feb 13 11:29:58 2008
@@ -995,7 +995,7 @@
   // Strip off a cast to void*, if it exists.
   if (const CastExpr *CE = dyn_cast<CastExpr>(this)) {
     // Check that it is a cast to void*.
-    if (const PointerType *PT = dyn_cast<PointerType>(CE->getType())) {
+    if (const PointerType *PT = CE->getType()->getAsPointerType()) {
       QualType Pointee = PT->getPointeeType();
       if (Pointee.getQualifiers() == 0 && Pointee->isVoidType() && // to void*
           CE->getSubExpr()->getType()->isIntegerType())            // from int.

Modified: cfe/trunk/test/Sema/conditional-expr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/conditional-expr.c?rev=47069&r1=47068&r2=47069&view=diff

==============================================================================
--- cfe/trunk/test/Sema/conditional-expr.c (original)
+++ cfe/trunk/test/Sema/conditional-expr.c Wed Feb 13 11:29:58 2008
@@ -31,5 +31,8 @@
   enum {xxx,yyy,zzz} e, *ee;
   short x;
   ee = ee ? &x : ee ? &i : &e; // expected-warning {{pointer type mismatch}}
+
+  typedef void *asdf;
+  *(0 ? (asdf) 0 : &x) = 10;
 }
 





More information about the cfe-commits mailing list