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 c++] (__attribute__((deprecated)), part a) Fix PR17729


Hi Jason,

It's taken a while to find some more time for this - (ObJC LTO and emutls.... etc. etc.)

On 9 Jun 2010, at 04:19, Jason Merrill wrote:

On 06/08/2010 07:13 PM, IainS wrote:
the question then, is how to prevent the duplicates, since those places
are called from more than one part of the process (or, at least, they
were when I last looked).

For non-function members, I think removing the call in finish_class_member_access_expr ought to do the trick, letting build_class_member_access_expr handle the warning.

done


For functions, perhaps just warning in mark_used would work. Then removing the calls in build_over_call and build_call_a and conditioning the one in finish_id_expression on !is_overloaded_fn.

unfortunately, not
mark_used is called even more often than build_over_call & build_call_a (at one stage I ended up with three warning messages)...


It seems that there is no nice place to put these diagnostics, that is only visited once (for the current formulation***);
Hence we end up checking in several places (which, I agree, does not seem ideal).


The attached patch has been bootstrapped/checked on i686-apple-darwin9

I've added a test-case for overloaded functions, member funcs are covered in deprecated-{4,6} iirc.

thoughts?

Iain

*** It seems to me that the diagnostics might be better done at the stage that the parser has decided that (other than deprecation) a given construct is OK.
(I guess just before swallowing the ";"). However, I don't know if this is reasonable, &| there would be enough information preserved to make the diagnostic neat (although it seems that there should).



gcc/cp:


	PR c++/17729
	* typeck.c (finish_class_member_access_expr): Remove duplicate
	deprecation check.
	* call.c (build_call_a): Do not check deprecation here.
	(build_over_call): Ditto.
	(build_new_function_call): Check for deprecated overloaded funcs
	here.
	(convert_like_real): Check for deprecated functions.
	(build_new_method_call): Ditto.

gcc/testsuite:

	PR c++/17729
	* g++.dg/warn/pr17729-1-fields.C: New.
	* g++.dg/warn/pr17729-2-funcs.C: New.
	* g++.dg/warn/deprecated-7.C: New.

Attachment: 162302-pr17729.txt
Description: Text document




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