aaron.ballman added a comment.
The attribute is not used anywhere; the initial utility should be part of the
patch introducing the attribute, unless that utility makes the patch very large.
================
Comment at: lib/Sema/SemaDeclAttr.cpp:1522-1523
+ QualType T = cast<ParmVarDecl>(D)->getType();
+ if (!T->isAnyPointerType() && !T->isBlockPointerType() &&
+ !T->isReferenceType() && !T->isArrayType() && !T->isMemberPointerType())
{
+ S.Diag(Attr.getLoc(), diag::warn_attribute_noescape_non_pointer) << T;
----------------
I don't think the type checking here is correct, at least according to the
documentation. For instance, you don't appear to care whether the parameter is
an array of block pointers vs an array of ints. Similar for the other composite
types.
================
Comment at: test/SemaObjCXX/noescape.mm:8
+void invalidFunc(int __attribute__((noescape))); // expected-warning
{{'noescape' attribute ignored on parameter of non-pointer type}}
+int __attribute__((noescape)) g; // expected-warning {{'noescape' attribute
only applies to parameters}}
----------------
You should also have a test ensuring the attribute diagnoses when given an
argument.
https://reviews.llvm.org/D32210
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits