]> granicus.if.org Git - clang/commitdiff
Don't use canonical type for sema here. In
authorChris Lattner <sabre@nondot.org>
Mon, 30 Jul 2007 18:53:26 +0000 (18:53 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 30 Jul 2007 18:53:26 +0000 (18:53 +0000)
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)

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

Sema/SemaExpr.cpp

index 557eb7220b8af3d65d15c18545b90410965c6001..233c0bbcad783ded784c668f4464e06917e55145 100644 (file)
@@ -1290,7 +1290,7 @@ QualType Sema::CheckIndirectionOperand(Expr *op, SourceLocation OpLoc) {
   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