[cfe-commits] r40597 - /cfe/trunk/Sema/SemaExpr.cpp

Chris Lattner sabre at nondot.org
Mon Jul 30 11:53:27 PDT 2007


Author: lattner
Date: Mon Jul 30 13:53:26 2007
New Revision: 40597

URL: http://llvm.org/viewvc/llvm-project?rev=40597&view=rev
Log:
Don't use canonical type for sema here.  In

void func() {
typedef int foo;
foo *Y;
**Y; // error
}

we now get:
indirection requires pointer operand ('foo' invalid)
instead of:
indirection requires pointer operand ('int' invalid)


Modified:
    cfe/trunk/Sema/SemaExpr.cpp

Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=40597&r1=40596&r2=40597&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Mon Jul 30 13:53:26 2007
@@ -1290,7 +1290,7 @@
   UsualUnaryConversions(op);
   QualType qType = op->getType();
   
-  if (PointerType *PT = dyn_cast<PointerType>(qType.getCanonicalType())) {
+  if (const PointerType *PT = qType->isPointerType()) {
     QualType ptype = PT->getPointeeType();
     // C99 6.5.3.2p4. "if it points to an object,...".
     if (ptype->isIncompleteType()) { // An incomplete type is not an object





More information about the cfe-commits mailing list