diff mbox

C++ PATCH for c++/53756 (-g and C++1y auto)

Message ID 52E8229D.8010502@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Jan. 28, 2014, 9:35 p.m. UTC
Hi,

On 01/28/2014 10:02 PM, Jason Merrill wrote:
> On 01/28/2014 01:33 PM, Paolo Carlini wrote:
>> Ah! Then I guess that in order to fix c++/58561 only is_base_type needs
>> tweaking: shall we change the default to just return 0?
> Makes sense.
Good. Then I'm finishing testing the below.

Thanks,
Paolo.

/////////////////
/cp
2013-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58581
	* call.c (build_over_call): Check return value of mark_used.

/testsuite
2013-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58581
	* g++.dg/cpp0x/deleted1.C: New.

Comments

Jason Merrill Jan. 29, 2014, 4:42 p.m. UTC | #1
On 01/28/2014 04:35 PM, Paolo Carlini wrote:
> +      if (is_cxx ())
> +	{
> +	  tree name = TYPE_NAME (type);
> +	  if (TREE_CODE (name) == TYPE_DECL)
> +	    name = DECL_NAME (name);
> +	  if (name == get_identifier ("auto"))
> +	    return 0;

Rather than duplicate this code, let's factor it out into a separate 
function.

Also, your ChangeLog has nothing to do with the patch.  :)

Jason
Paolo Carlini Jan. 29, 2014, 4:48 p.m. UTC | #2
On 01/29/2014 05:42 PM, Jason Merrill wrote:
> On 01/28/2014 04:35 PM, Paolo Carlini wrote:
>> +      if (is_cxx ())
>> +    {
>> +      tree name = TYPE_NAME (type);
>> +      if (TREE_CODE (name) == TYPE_DECL)
>> +        name = DECL_NAME (name);
>> +      if (name == get_identifier ("auto"))
>> +        return 0;
>
> Rather than duplicate this code, let's factor it out into a separate 
> function.
Yeah, you are totally right, we have at least 3/4 uses of that. Care to 
propose a name?
> Also, your ChangeLog has nothing to do with the patch.  :)
:) I attached 58581 instead of 58561.

Paolo.
Jason Merrill Jan. 29, 2014, 5 p.m. UTC | #3
On 01/29/2014 11:48 AM, Paolo Carlini wrote:
>> Rather than duplicate this code, let's factor it out into a separate
>> function.
> Yeah, you are totally right, we have at least 3/4 uses of that. Care to
> propose a name?

is_cxx_auto?

Jason
diff mbox

Patch

Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 207199)
+++ dwarf2out.c	(working copy)
@@ -10252,6 +10252,16 @@  is_base_type (tree type)
       return 0;
 
     default:
+      // A C++ function with deduced return type can have
+      // a TEMPLATE_TYPE_PARM named 'auto' in its type.
+      if (is_cxx ())
+	{
+	  tree name = TYPE_NAME (type);
+	  if (TREE_CODE (name) == TYPE_DECL)
+	    name = DECL_NAME (name);
+	  if (name == get_identifier ("auto"))
+	    return 0;
+	}
       gcc_unreachable ();
     }
 
Index: testsuite/g++.dg/cpp1y/auto-fn23.C
===================================================================
--- testsuite/g++.dg/cpp1y/auto-fn23.C	(revision 0)
+++ testsuite/g++.dg/cpp1y/auto-fn23.C	(working copy)
@@ -0,0 +1,9 @@ 
+// PR c++/58561
+// { dg-options "-std=c++1y -g" }
+
+auto foo();
+
+namespace N
+{
+  using ::foo;
+}