aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-04-11 18:36:25 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-04-11 18:36:25 +0000
commit11fe27a56b9b4da5ecd8534bfe7fed755d2a1b42 (patch)
treec3c8e792cd4444b837f00acf7560fca7a6017a38
parentf401d0f52653fd3112d8b6a12dc4d474a0f9faaa (diff)
downloadgcc-11fe27a56b9b4da5ecd8534bfe7fed755d2a1b42.zip
gcc-11fe27a56b9b4da5ecd8534bfe7fed755d2a1b42.tar.gz
gcc-11fe27a56b9b4da5ecd8534bfe7fed755d2a1b42.tar.bz2
c-tree.texi (Functions): Remove DECL_REAL_CONTEXT documentation; add DECL_FRIEND_CONTEXT.
* doc/c-tree.texi (Functions): Remove DECL_REAL_CONTEXT documentation; add DECL_FRIEND_CONTEXT. From-SVN: r65472
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/c-tree.texi29
2 files changed, 20 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35c7a34..9a558be 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/c-tree.texi (Functions): Remove DECL_REAL_CONTEXT
+ documentation; add DECL_FRIEND_CONTEXT.
+
2003-04-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* doc/install.texi (hppa): Update links for HP-UX patches. Revise
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi
index fbc90fa..ff5a5fa 100644
--- a/gcc/doc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -1021,34 +1021,35 @@ will always return the function itself, and @code{OVL_NEXT} will always
be @code{NULL_TREE}.
To determine the scope of a function, you can use the
-@code{DECL_REAL_CONTEXT} macro. This macro will return the class
+@code{DECL_CONTEXT} macro. This macro will return the class
(either a @code{RECORD_TYPE} or a @code{UNION_TYPE}) or namespace (a
@code{NAMESPACE_DECL}) of which the function is a member. For a virtual
function, this macro returns the class in which the function was
actually defined, not the base class in which the virtual declaration
-occurred. If a friend function is defined in a class scope, the
-@code{DECL_CLASS_CONTEXT} macro can be used to determine the class in
+occurred.
+
+If a friend function is defined in a class scope, the
+@code{DECL_FRIEND_CONTEXT} macro can be used to determine the class in
which it was defined. For example, in
@example
class C @{ friend void f() @{@} @};
@end example
-the @code{DECL_REAL_CONTEXT} for @code{f} will be the
-@code{global_namespace}, but the @code{DECL_CLASS_CONTEXT} will be the
+@noindent
+the @code{DECL_CONTEXT} for @code{f} will be the
+@code{global_namespace}, but the @code{DECL_FRIEND_CONTEXT} will be the
@code{RECORD_TYPE} for @code{C}.
-The @code{DECL_REAL_CONTEXT} and @code{DECL_CLASS_CONTEXT} are not
-available in C; instead you should simply use @code{DECL_CONTEXT}. In C,
-the @code{DECL_CONTEXT} for a function maybe another function. This
-representation indicates that the GNU nested function extension is in
-use. For details on the semantics of nested functions, see the GCC
-Manual. The nested function can refer to local variables in its
+In C, the @code{DECL_CONTEXT} for a function maybe another function.
+This representation indicates that the GNU nested function extension
+is in use. For details on the semantics of nested functions, see the
+GCC Manual. The nested function can refer to local variables in its
containing function. Such references are not explicitly marked in the
tree structure; back ends must look at the @code{DECL_CONTEXT} for the
referenced @code{VAR_DECL}. If the @code{DECL_CONTEXT} for the
referenced @code{VAR_DECL} is not the same as the function currently
-being processed, and neither @code{DECL_EXTERNAL} nor @code{DECL_STATIC}
-hold, then the reference is to a local variable in a containing
-function, and the back end must take appropriate action.
+being processed, and neither @code{DECL_EXTERNAL} nor
+@code{DECL_STATIC} hold, then the reference is to a local variable in
+a containing function, and the back end must take appropriate action.
@menu
* Function Basics:: Function names, linkage, and so forth.