[clang] 6e916b5 - Updating the documentation for the noescape attribute.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 13:21:48 PDT 2020


Author: Aaron Ballman
Date: 2020-04-01T16:21:37-04:00
New Revision: 6e916b5860950fee2661ded847abe551f5259ec4

URL: https://github.com/llvm/llvm-project/commit/6e916b5860950fee2661ded847abe551f5259ec4
DIFF: https://github.com/llvm/llvm-project/commit/6e916b5860950fee2661ded847abe551f5259ec4.diff

LOG: Updating the documentation for the noescape attribute.

A question came up from a glibc maintainer as to whether it was permissible to
free a pointer marked [[clang::noescape]], and after investigation, I
determined that this is allowed. This updates the documentation in case others
have the same question.

Added: 
    

Modified: 
    clang/include/clang/Basic/AttrDocs.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index 2c89dc6f4952..bdc47b43c34b 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -140,7 +140,8 @@ def NoEscapeDocs : Documentation {
 the compiler that the pointer cannot escape: that is, no reference to the object
 the pointer points to that is derived from the parameter value will survive
 after the function returns. Users are responsible for making sure parameters
-annotated with ``noescape`` do not actuallly escape.
+annotated with ``noescape`` do not actuallly escape. Calling ``free()`` on such
+a parameter does not constitute an escape.
 
 For example:
 


        


More information about the cfe-commits mailing list