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
This commit is contained in:
Chris Lattner 2007-07-30 18:53:26 +00:00
parent 212d5c27f6
commit fedeaa3045
1 changed files with 1 additions and 1 deletions

View 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