diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-30 18:53:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-30 18:53:26 +0000 |
commit | d51d89095484a33228010040a5986cebd61d6c61 (patch) | |
tree | a7dc2cc7ff7999c4793f6ae8499cc97715160b7a | |
parent | fcac0fff877a461bc5d5a57e6c6727a4c819d95a (diff) |
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40597 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Sema/SemaExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 557eb7220b..233c0bbcad 100644 --- a/Sema/SemaExpr.cpp +++ b/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<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 |