From fedeaa304517b29ef3bb95519c5e8daef5569c73 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 30 Jul 2007 18:53:26 +0000 Subject: [PATCH] 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) llvm-svn: 40597 --- clang/Sema/SemaExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp index 557eb7220b8a..233c0bbcad78 100644 --- a/clang/Sema/SemaExpr.cpp +++ b/clang/Sema/SemaExpr.cpp @@ -1290,7 +1290,7 @@ QualType Sema::CheckIndirectionOperand(Expr *op, SourceLocation OpLoc) { UsualUnaryConversions(op); QualType qType = op->getType(); - if (PointerType *PT = dyn_cast(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