diff mbox

[C++] Fix PR60761, diagnostics in clones

Message ID 20140410131942.GB1817@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek April 10, 2014, 1:19 p.m. UTC
On Wed, Apr 09, 2014 at 02:10:04PM -0400, Jason Merrill wrote:
> On 04/09/2014 04:21 AM, Richard Biener wrote:
> >>The names of the in-charge and not-in-charge constructor clones are
> >>complete_ctor_identifier and base_ctor_identifier (and dtor for
> >>destructors); you could check for those.
> >
> >I was more asking for how we present those To the user in diagnostics. I wanted to use a consistent 'quoting' style. If using <clone> is fine then I'll just stick to that.
> 
> I think saying <complete> and <base> would be helpful for
> distinguishing them.

My preference for 4.9 would be just print the abstract name
and nothing else and for stage1 improve that to make it clear
what is a clone (and with what kind of changes), what is which cdtor etc.

Thus, I've bootstrapped/regtested this version on x86_64-linux and
i686-linux, is this ok to everybody for now?

2014-04-10  Richard Biener  <rguenther@suse.de>
	    Jakub Jelinek  <jakub@redhat.com>

	PR ipa/60761
	* error.c (dump_decl) <case FUNCTION_DECL>: If
	DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
	recurse on DECL_ABSTRACT_ORIGIN instead of printing
	<built-in>.



	Jakub

Comments

Richard Biener April 10, 2014, 3:34 p.m. UTC | #1
On April 10, 2014 3:19:42 PM CEST, Jakub Jelinek <jakub@redhat.com> wrote:
>On Wed, Apr 09, 2014 at 02:10:04PM -0400, Jason Merrill wrote:
>> On 04/09/2014 04:21 AM, Richard Biener wrote:
>> >>The names of the in-charge and not-in-charge constructor clones are
>> >>complete_ctor_identifier and base_ctor_identifier (and dtor for
>> >>destructors); you could check for those.
>> >
>> >I was more asking for how we present those To the user in
>diagnostics. I wanted to use a consistent 'quoting' style. If using
><clone> is fine then I'll just stick to that.
>> 
>> I think saying <complete> and <base> would be helpful for
>> distinguishing them.
>
>My preference for 4.9 would be just print the abstract name
>and nothing else and for stage1 improve that to make it clear
>what is a clone (and with what kind of changes), what is which cdtor
>etc.
>
>Thus, I've bootstrapped/regtested this version on x86_64-linux and
>i686-linux, is this ok to everybody for now?

Works for me.

Richard.

>2014-04-10  Richard Biener  <rguenther@suse.de>
>	    Jakub Jelinek  <jakub@redhat.com>
>
>	PR ipa/60761
>	* error.c (dump_decl) <case FUNCTION_DECL>: If
>	DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
>	recurse on DECL_ABSTRACT_ORIGIN instead of printing
>	<built-in>.
>
>--- gcc/cp/error.c.jj	2014-03-03 08:24:14.000000000 +0100
>+++ gcc/cp/error.c	2014-04-10 12:10:39.065707779 +0200
>@@ -1145,7 +1145,12 @@ dump_decl (cxx_pretty_printer *pp, tree
> 
>     case FUNCTION_DECL:
>       if (! DECL_LANG_SPECIFIC (t))
>-	pp_string (pp, M_("<built-in>"));
>+	{
>+	  if (DECL_ABSTRACT_ORIGIN (t))
>+	    dump_decl (pp, DECL_ABSTRACT_ORIGIN (t), flags);
>+	  else
>+	    pp_string (pp, M_("<built-in>"));
>+	}
>       else if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
> 	dump_global_iord (pp, t);
>       else
>
>
>	Jakub
Jason Merrill April 10, 2014, 4:16 p.m. UTC | #2
On 04/10/2014 09:19 AM, Jakub Jelinek wrote:
> Thus, I've bootstrapped/regtested this version on x86_64-linux and
> i686-linux, is this ok to everybody for now?

OK.

Jason
diff mbox

Patch

--- gcc/cp/error.c.jj	2014-03-03 08:24:14.000000000 +0100
+++ gcc/cp/error.c	2014-04-10 12:10:39.065707779 +0200
@@ -1145,7 +1145,12 @@  dump_decl (cxx_pretty_printer *pp, tree
 
     case FUNCTION_DECL:
       if (! DECL_LANG_SPECIFIC (t))
-	pp_string (pp, M_("<built-in>"));
+	{
+	  if (DECL_ABSTRACT_ORIGIN (t))
+	    dump_decl (pp, DECL_ABSTRACT_ORIGIN (t), flags);
+	  else
+	    pp_string (pp, M_("<built-in>"));
+	}
       else if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
 	dump_global_iord (pp, t);
       else