diff options
author | Alex Samuel <samuel@codesourcery.com> | 2000-11-21 04:38:08 +0000 |
---|---|---|
committer | Alex Samuel <samuel@gcc.gnu.org> | 2000-11-21 04:38:08 +0000 |
commit | beac9b932c42ba0e22d92b92ccb26117354aa564 (patch) | |
tree | 1c89e6bc8283aeae28a745a831bd8892d09de06b /gcc/cp/mangle.c | |
parent | 5d81021ea10554480ecd0054a65461675a31b847 (diff) | |
download | gcc-beac9b932c42ba0e22d92b92ccb26117354aa564.zip gcc-beac9b932c42ba0e22d92b92ccb26117354aa564.tar.gz gcc-beac9b932c42ba0e22d92b92ccb26117354aa564.tar.bz2 |
mangle.c (write_name): Use <unscoped-name> for names directly in function scope.
* mangle.c (write_name): Use <unscoped-name> for names directly in
function scope.
(write_unscoped_name): Accept names directly in function scope.
From-SVN: r37603
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 7353cf8..d4ffaff 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -674,10 +674,15 @@ write_name (decl, ignore_local_scope) else context = (DECL_CONTEXT (decl) == NULL) ? NULL : CP_DECL_CONTEXT (decl); - /* Decls in :: or ::std scope are treated specially. */ + /* A decl in :: or ::std scope is treated specially. The former is + mangled using <unscoped-name> or <unscoped-template-name>, the + latter with a special substitution. Also, a name that is + directly in a local function scope is also mangled with + <unscoped-name> rather than a full <nested-name>. */ if (context == NULL || context == global_namespace - || DECL_NAMESPACE_STD_P (context)) + || DECL_NAMESPACE_STD_P (context) + || (ignore_local_scope && TREE_CODE (context) == FUNCTION_DECL)) { tree template_info; /* Is this a template instance? */ @@ -748,8 +753,11 @@ write_unscoped_name (decl) write_string ("St"); write_unqualified_name (decl); } - /* If not, it should be in the global namespace. */ - else if (context == global_namespace || context == NULL) + /* If not, it should be either in the global namespace, or directly + in a local function scope. */ + else if (context == global_namespace + || context == NULL + || TREE_CODE (context) == FUNCTION_DECL) write_unqualified_name (decl); else my_friendly_abort (20000521); |