Skip to content
Snippets Groups Projects
Commit bd3d082e authored by Kriang Lerdsuwanakij's avatar Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij
Browse files

Friend class name lookup 5/n PR c++/1016

	Friend class name lookup 5/n
	PR c++/1016
	* cp-tree.h (pushtag): Adjust declaration.
	* decl.c (lookup_and_check_tag): Call lookup_type_scope if
	lookup_name fails.
	(xref_tag): Adjust call to pushtag.  Make hidden class visible.
	(start_enum): Adjust call to pushtag.
	* name-lookup.c (ambiguous_decl): Ignore hidden names.
	(qualify_lookup): Change return type to bool.
	(hidden_name_p): New function.
	(lookup_namespace_name, unqualified_namespace_lookup,
	lookup_name_real): Use it.
	(lookup_type_scope): Update comments.
	(maybe_process_template_type_declaration): Change parameter name
	from globalize to is_friend.
	(pushtag): Change globalize parameter of type int to tag_scope.
	Hide name if introduced by friend declaration.
	* name-lookup.h (hidden_name_p): Add declaration.
	* parser.c (cp_parser_lookup_name): Don't deal with hidden name
	here.
	* pt.c (push_template_decl_real): Make hidden class template
	visible.
	(lookup_template_class, instantiate_class_template): Adjust call
	to pushtag.
	* semantics.c (begin_class_definition): Likewise.
	* rtti.c (init_rtti_processing, build_dynamic_cast_1,
	tinfo_base_init, emit_support_tinfos): Use ts_current instead of
	ts_global.

	* g++.dg/lookup/hidden-class1.C: New test.
	* g++.dg/lookup/hidden-class2.C: Likewise.
	* g++.dg/lookup/hidden-class3.C: Likewise.
	* g++.dg/lookup/hidden-class4.C: Likewise.
	* g++.dg/lookup/hidden-class5.C: Likewise.
	* g++.dg/lookup/hidden-class6.C: Likewise.
	* g++.dg/lookup/hidden-class7.C: Likewise.
	* g++.dg/lookup/hidden-class8.C: Likewise.
	* g++.dg/lookup/hidden-class9.C: Likewise.
	* g++.dg/lookup/hidden-temp-class1.C: Likewise.
	* g++.dg/lookup/hidden-temp-class2.C: Likewise.
	* g++.dg/lookup/hidden-temp-class3.C: Likewise.
	* g++.dg/lookup/hidden-temp-class4.C: Likewise.
	* g++.dg/lookup/hidden-temp-class5.C: Likewise.
	* g++.dg/lookup/hidden-temp-class6.C: Likewise.
	* g++.dg/lookup/hidden-temp-class7.C: Likewise.
	* g++.dg/lookup/hidden-temp-class8.C: Likewise.
	* g++.dg/lookup/hidden-temp-class9.C: Likewise.
	* g++.dg/lookup/hidden-temp-class10.C: Likewise.
	* g++.dg/lookup/hidden-temp-class11.C: Likewise.

From-SVN: r96430
parent a2130901
No related branches found
No related tags found
No related merge requests found
Showing
with 265 additions and 51 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment