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: [Patch] PR c++/26256


Hi,

Here is an updated patch that should address some (all ?) issues you
have noticed.

[...]
> It seems like this only works if there is a using in the most derived class;
> a using in an intermediate class wouldn't avoid the ambiguity.
>
> I'd prefer to tear out the old access declaration code and actually handle
> USING_DECLs directly in lookup_field_r et al.

I have moved the call to disambiguate_with_using_decl in
lookup_field_r, which simplify things, thanks.
disambiguate_with_using_decl has also been improved so that it can
look for a using decl in an intermediate base class. Basically, it
recurses on bases provided all using decl context classes are a base
for the current class.

[...]
> @@ -1431,6 +1431,8 @@ dbxout_type_fields (tree type)
> +         || TREE_CODE (tem) == USING_DECL

> This will break bootstrap when C++ isn't enabled.  Instead, check TREE_CODE > END_OF_BASE_TREE_CODES.

Sounds like it doesn't work. Instead, I've checked TREE_CODE >=
LAST_AND_UNUSED_TREE_CODE.

Bootstrapped with all default languages, and with C only.
Tested x86_64-unknown-linux-gnu.

OK for trunk ?


gcc/ChangeLog

2010-06-15  Fabien ChÃne  <fabien@gcc.gnu.org>

	PR c++/26256
	* dbxout.c (dbxout_type_fields): Ignore using declarations.


gcc/testsuite/ChangeLog

2010-06-15  Fabien ChÃne  <fabien@gcc.gnu.org>

	PR c++/26256
	* g++.dg/lookup/using23.C: New.
	* 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/debug/using4.C: New.
	* g++.dg/debug/using5.C: New.

gcc/cp/ChangeLog

2010-06-15  Fabien ChÃne  <fabien@gcc.gnu.org>

	PR c++/26256
	* search.c (disambiguate_with_using_decl): Define. Try to
	disambiguate a field type or a field decl with using declarations.
	(lookup_field_r): Call disambiguate_with_using_decl when an
	ambiguity has been encountered.
	* class.c (count_fields): Ignore using declarations.
	(add_fields_to_record_type): Likewise.
	(check_field_decls): Keep using declarations.


-- 
Fabien

Attachment: pr26256.patch
Description: Binary data


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