Commit 844511c8 by Nathan Sidwell Committed by Nathan Sidwell

decl2.c (get_guard): Set linkage from guarded decl.

cp:
	* decl2.c (get_guard): Set linkage from guarded decl.

From-SVN: r38905
parent 79c9e159
2001-01-11 Nathan Sidwell <nathan@codesourcery.com> 2001-01-11 Nathan Sidwell <nathan@codesourcery.com>
* decl2.c (get_guard): Set linkage from guarded decl.
2001-01-11 Nathan Sidwell <nathan@codesourcery.com>
* call.c (convert_default_arg): Check for unprocessed * call.c (convert_default_arg): Check for unprocessed
DEFAULT_ARG. DEFAULT_ARG.
* cp-tree.h (replace_defarg): Move to spew.c. * cp-tree.h (replace_defarg): Move to spew.c.
......
...@@ -2856,11 +2856,17 @@ get_guard (decl) ...@@ -2856,11 +2856,17 @@ get_guard (decl)
guard_type = integer_type_node; guard_type = integer_type_node;
guard = build_decl (VAR_DECL, sname, guard_type); guard = build_decl (VAR_DECL, sname, guard_type);
TREE_PUBLIC (guard) = 1;
/* The guard should have the same linkage as what it guards. */
TREE_PUBLIC (guard) = TREE_PUBLIC (decl);
TREE_STATIC (guard) = TREE_STATIC (decl);
DECL_COMMON (guard) = DECL_COMMON (decl);
DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl);
if (TREE_PUBLIC (decl))
DECL_WEAK (guard) = DECL_WEAK (decl);
DECL_ARTIFICIAL (guard) = 1; DECL_ARTIFICIAL (guard) = 1;
TREE_STATIC (guard) = 1;
TREE_USED (guard) = 1; TREE_USED (guard) = 1;
DECL_COMMON (guard) = 1;
pushdecl_top_level (guard); pushdecl_top_level (guard);
cp_finish_decl (guard, NULL_TREE, NULL_TREE, 0); cp_finish_decl (guard, NULL_TREE, NULL_TREE, 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment