Commit 120722ac by Mark Mitchell Committed by Mark Mitchell

decl.c (shadow_label): Don't treat decls as identifiers.

	* decl.c (shadow_label): Don't treat decls as identifiers.
	(maybe_push_to_top_level): Clear shadowed_labels.
	* pt.c (instantiate_decl): Reset lineno and filename after calling
	regenerate_decl_from_template.

From-SVN: r20093
parent b608647a
1998-05-27 Mark Mitchell <mark@markmitchell.com> 1998-05-27 Mark Mitchell <mark@markmitchell.com>
* decl.c (shadow_label): Don't treat decls as identifiers.
(maybe_push_to_top_level): Clear shadowed_labels.
* pt.c (instantiate_decl): Reset lineno and filename after calling
regenerate_decl_from_template.
* decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
error_mark_node. error_mark_node.
......
...@@ -1992,6 +1992,7 @@ maybe_push_to_top_level (pseudo) ...@@ -1992,6 +1992,7 @@ maybe_push_to_top_level (pseudo)
current_lang_name = lang_name_cplusplus; current_lang_name = lang_name_cplusplus;
strict_prototype = strict_prototypes_lang_cplusplus; strict_prototype = strict_prototypes_lang_cplusplus;
named_labels = NULL_TREE; named_labels = NULL_TREE;
shadowed_labels = NULL_TREE;
minimal_parse_mode = 0; minimal_parse_mode = 0;
previous_class_type = previous_class_values = NULL_TREE; previous_class_type = previous_class_values = NULL_TREE;
processing_specialization = 0; processing_specialization = 0;
...@@ -4106,7 +4107,6 @@ shadow_label (name) ...@@ -4106,7 +4107,6 @@ shadow_label (name)
{ {
shadowed_labels = tree_cons (NULL_TREE, decl, shadowed_labels); shadowed_labels = tree_cons (NULL_TREE, decl, shadowed_labels);
SET_IDENTIFIER_LABEL_VALUE (name, NULL_TREE); SET_IDENTIFIER_LABEL_VALUE (name, NULL_TREE);
SET_IDENTIFIER_LABEL_VALUE (decl, NULL_TREE);
} }
return lookup_label (name); return lookup_label (name);
......
...@@ -7158,11 +7158,13 @@ instantiate_decl (d) ...@@ -7158,11 +7158,13 @@ instantiate_decl (d)
goto out; goto out;
} }
regenerate_decl_from_template (d, td);
/* We already set the file and line above. Reset them now in case
they changed as a result of calling regenerate_decl_from_template. */
lineno = DECL_SOURCE_LINE (d); lineno = DECL_SOURCE_LINE (d);
input_filename = DECL_SOURCE_FILE (d); input_filename = DECL_SOURCE_FILE (d);
regenerate_decl_from_template (d, td);
if (TREE_CODE (d) == VAR_DECL) if (TREE_CODE (d) == VAR_DECL)
{ {
DECL_IN_AGGR_P (d) = 0; DECL_IN_AGGR_P (d) = 0;
......
// Build don't link:
template <class T>
struct S {};
template <class T>
inline void g(T t)
{
here:
S<T> st;
goto here;
}
template <class T>
void f(T t)
{
here:
g(t);
goto here;
}
void h()
{
f(3);
}
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