summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-03-01 17:04:42 +0000
committerDouglas Gregor <dgregor@apple.com>2011-03-01 17:04:42 +0000
commit9760a666d603a814ce65c361f8d5eb6f0f64cfc7 (patch)
tree6ff7d8c255851909c16fb17006cffa84143bd4fe /clang/lib
parent84a6a0a3ce7d45a5a948e79f1a48f9fbf236a481 (diff)
downloadbcm5719-llvm-9760a666d603a814ce65c361f8d5eb6f0f64cfc7.tar.gz
bcm5719-llvm-9760a666d603a814ce65c361f8d5eb6f0f64cfc7.zip
When digging into a cv-qualified return type that is a pointer type to
diagnose ignored qualifiers on return types, only assume that there is a pointer chunk if the type is *structurally* a pointer type, not if it's a typedef of a pointer type. Fixes PR9328/<rdar://problem/9055428>. llvm-svn: 126751
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaType.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 1c8a58b07ce..afd118e2caa 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1728,7 +1728,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
// cv-qualifiers on return types are pointless except when the type is a
// class type in C++.
- if (T->isPointerType() && T.getCVRQualifiers() &&
+ if (isa<PointerType>(T) && T.getLocalCVRQualifiers() &&
(!getLangOptions().CPlusPlus || !T->isDependentType())) {
assert(chunkIndex + 1 < e && "No DeclaratorChunk for the return type?");
DeclaratorChunk ReturnTypeChunk = D.getTypeObject(chunkIndex + 1);
OpenPOWER on IntegriCloud