summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-15 15:41:46 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-15 15:41:46 +0000
commit1e2cdf593313d097816be24a6ca221b00e559857 (patch)
tree111217900d9474e8e91e6844c57b912fed0c7bc1 /clang/lib
parent03007d79fe9c2428a93c114c9f96e150dcb66f2d (diff)
downloadbcm5719-llvm-1e2cdf593313d097816be24a6ca221b00e559857.tar.gz
bcm5719-llvm-1e2cdf593313d097816be24a6ca221b00e559857.zip
__attribute__((nonnull)) can apply to reference-to-pointer
parameters. Fixes <rdar://problem/8769025>. llvm-svn: 121864
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 3453528d8a4..e9f885e62f3 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -371,7 +371,7 @@ static void HandleNonNullAttr(Decl *d, const AttributeList &Attr, Sema &S) {
}
// Is the function argument a pointer type?
- QualType T = getFunctionOrMethodArgType(d, x);
+ QualType T = getFunctionOrMethodArgType(d, x).getNonReferenceType();
if (!T->isAnyPointerType() && !T->isBlockPointerType()) {
// FIXME: Should also highlight argument in decl.
S.Diag(Attr.getLoc(), diag::warn_nonnull_pointers_only)
@@ -386,7 +386,7 @@ static void HandleNonNullAttr(Decl *d, const AttributeList &Attr, Sema &S) {
// arguments have a nonnull attribute.
if (NonNullArgs.empty()) {
for (unsigned I = 0, E = getFunctionOrMethodNumArgs(d); I != E; ++I) {
- QualType T = getFunctionOrMethodArgType(d, I);
+ QualType T = getFunctionOrMethodArgType(d, I).getNonReferenceType();
if (T->isAnyPointerType() || T->isBlockPointerType())
NonNullArgs.push_back(I);
else if (const RecordType *UT = T->getAsUnionType()) {
OpenPOWER on IntegriCloud