The manual gives alias, visibility and weak as examples of the
attributes that the copy attribute does not copy. handle_copy_attribute
also skips ifunc and weakref, the inlining attributes always_inline,
gnu_inline and noinline, unavailable since the previous patch, and leaf
on static functions. Someone copying from an always_inline or noinline
function might not expect the inlining behaviour to stay behind, so name
them all
Also say "attributes are" where the same sentence said "attribute are"
gcc/ChangeLog:
* doc/extend.texi (Common Attributes) <copy>: List the attributes
it does not copy. Fix a grammar error.
Signed-off-by: Hugo Sales <[email protected]>
---
gcc/doc/extend.texi | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index eb8dd1b04f4..5d0a82c5499 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2589,10 +2589,14 @@ to specify the same set of attributes as their targets.
The @code{copy}
attribute can be used with functions, variables, or types. However,
the kind of symbol to which the attribute is applied (either function
or variable) must match the kind of symbol to which the argument refers.
-The @code{copy} attribute copies only syntactic and semantic attributes
-but not attributes that affect a symbol's linkage or visibility such as
-@code{alias}, @code{visibility}, or @code{weak}. The @code{deprecated}
-and @code{target_clones} attribute are also not copied.
+The @code{copy} attribute copies only syntactic and semantic attributes.
+It does not copy attributes that affect a symbol's linkage or
+visibility, namely @code{alias}, @code{ifunc}, @code{visibility},
+@code{weak}, and @code{weakref}, or attributes that affect inlining,
+namely @code{always_inline}, @code{gnu_inline}, and @code{noinline}.
+The @code{deprecated}, @code{unavailable}, and @code{target_clones}
+attributes are not copied either, and @code{leaf} is not copied to a
+static function.
For example, the @var{StrongAlias} macro below makes use of the @code{alias}
and @code{copy} attributes to define an alias named @var{alloc} for function
--
2.56.0