This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR c++/30195


Hi,

2011/11/10 Jason Merrill <jason@redhat.com>:
> On 11/09/2011 03:58 PM, Fabien Chêne wrote:
>>
>> Well, here it is. I've added a very simple function in order to guess
>> if a name is a declaration or a definition.
>
> This seems unnecessary; a definition is also a declaration, so it's always
> correct to talk about a previous declaration.

I like the convenience of such a definition, sorry for the distraction.

>> + ? ? ? ? if (dependent_type_p (current_class_type)
>> + ? ? ? ? ? ? && is_overloaded_fn (target_decl))
>> + ? ? ? ? ? add_method (current_class_type, OVL_CURRENT (target_decl),
>> decl);
>
> If target_decl is overloaded, this should iterate through to add all of the
> functions in the list.

Fixed.

> As this dbxout backend code already ignores DECLs marked DECL_IGNORED_P,
> maybe it would be best to have the front-end mark the USING_DECL as
> DECL_IGNORED_P; possibly in finish_member_declaration?

Done, thanks.

Bootstrapped, tested on x86_64-unkown-linux-gnu without new regressions.


gcc/testsuite/ChangeLog

2011-11-13  Fabien Chêne  <fabien@gcc.gnu.org>

	PR c++/6936
	PR c++/25994
	PR c++/26256
	PR c++/30195
	* g++.old-deja/g++.brendan/misc14.C: Adjust.
	* g++.old-deja/g++.jason/scoping16.C: Likewise.
	* g++.old-deja/g++.other/anon7.C: Likewise.
	* g++.old-deja/g++.other/using1.C: Likewise.
	* g++.old-deja/g++.other/redecl1.C: Likewise.
	* g++.old-deja/g++.other/typedef7.C: Likewise.
	* g++.old-deja/g++.bugs/900127_02.C: Likewise.
	* g++.dg/template/using2.C: Likewise.
	* g++.dg/template/static4.C: Likewise.
	* g++.dg/template/typedef1.C: Likewise.
	* g++.dg/lookup/name-clash9.C: Likewise.
	* g++.dg/abi/mangle41.C: Likewise.
	* g++.dg/parse/ctor5.C: Likewise.
	* g++.dg/inherit/using4.C: Likewise.
	* g++.dg/lookup/using24.C: New.
	* g++.dg/lookup/using25.C: New.
	* g++.dg/lookup/using26.C: New.
	* g++.dg/lookup/using27.C: New.
	* g++.dg/lookup/using28.C: New.
	* g++.dg/lookup/using29.C: New.
	* g++.dg/lookup/using30.C: New.
	* g++.dg/lookup/using31.C: New.
	* g++.dg/lookup/using32.C: New.
	* g++.dg/lookup/using33.C: New.
	* g++.dg/lookup/using34.C: New.
	* g++.dg/lookup/using35.C: New.
	* g++.dg/lookup/using36.C: New.
	* g++.dg/lookup/using37.C: New.
	* g++.dg/lookup/using38.C: New.
	* g++.dg/lookup/using39.C: New.
	* g++.dg/lookup/using40.C: New.
	* g++.dg/lookup/using41.C: New.
	* g++.dg/lookup/using42.C: New.
	* g++.dg/lookup/using43.C: New.
	* g++.dg/lookup/using44.C: New.
	* g++.dg/lookup/using45.C: New.
	* g++.dg/lookup/pr6936.C: New.
	* g++.dg/debug/using4.C: New.
	* g++.dg/debug/using5.C: New.
	* g++.dg/cpp0x/forw_enum10.C: New.


gcc/cp/ChangeLog

2011-11-13  Fabien Chêne  <fabien@gcc.gnu.org>

	PR c++/6936
	PR c++/25994
	PR c++/26256
	PR c++/30195
	* search.c (lookup_field_1): Get rid of the comment saying that
	USING_DECL should not be returned, and actually return USING_DECL
	if appropriate.
	(lookup_field_r): Call lookup_fnfields_slot instead of
	lookup_fnfields_1.
	* semantics.c (finish_member_declaration): Remove the check that
	prevents USING_DECLs from being verified by
	pushdecl_class_level. Call add_method for using declarations that
	designates functions if the using declaration is in a template
	class. Set DECL_IGNORED_P on class-scope using declarations.
	* typeck.c (build_class_member_access_expr): Handle USING_DECLs.
	* class.c (check_field_decls): Keep using declarations.
	(add_method): Remove two diagnostics about conflicting using
	declarations.
	* parser.c (cp_parser_nonclass_name): Handle USING_DECLs.
	* decl.c (start_enum): Call xref_tag whenever possible.
	* cp-tree.h (strip_using_decl): Declare, and reident the previous
	function.
	* name-lookup.c (strip_using_decl): New function.
	(supplement_binding_1): Call strip_using_decl on decl and
	bval. Perform most of the checks with USING_DECLs stripped.  Also
	check that the target decl and the target bval does not refer to
	the same declaration. Allow pushing an enum multiple times in a
	template class. Adjustment to diagnose using redeclarations. Call
	diagnose_name_conflict.
	(push_class_level_binding): Call strip_using_decl on decl and
	bval. Perform most of the checks with USING_DECLs stripped. Return
	true if both decl and bval refer to USING_DECLs and are dependent.
	(diagnose_name_conflict): New function.


-- 
Fabien

Attachment: using_3
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]