public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add testcase for c++/68116
@ 2015-12-07 17:49 Marek Polacek
  2015-12-08 11:54 ` Bernd Schmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Polacek @ 2015-12-07 17:49 UTC (permalink / raw)
  To: GCC Patches

This testcase used to ICE, but compiles fine since the C++ delayed folding
merge.  I'd like to add it to the testsuite and close the PR.

Tested on x86_64-linux, ok for trunk?

2015-12-07  Marek Polacek  <polacek@redhat.com>

	PR c++/68116
	* g++.dg/cpp0x/pr68116.C: New test.

diff --git gcc/testsuite/g++.dg/cpp0x/pr68116.C gcc/testsuite/g++.dg/cpp0x/pr68116.C
index e69de29..04ed901 100644
--- gcc/testsuite/g++.dg/cpp0x/pr68116.C
+++ gcc/testsuite/g++.dg/cpp0x/pr68116.C
@@ -0,0 +1,12 @@
+// PR c++/68116
+// { dg-do compile { target c++11 } }
+
+class C {
+  void foo ();
+  typedef void (C::*T) (int);
+  static T b[];
+};
+C::T C::b[]
+{
+  T (&C::foo)
+};

	Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add testcase for c++/68116
  2015-12-07 17:49 [PATCH] Add testcase for c++/68116 Marek Polacek
@ 2015-12-08 11:54 ` Bernd Schmidt
  2015-12-08 14:15   ` Jason Merrill
  0 siblings, 1 reply; 5+ messages in thread
From: Bernd Schmidt @ 2015-12-08 11:54 UTC (permalink / raw)
  To: Marek Polacek, GCC Patches, Jason Merrill

On 12/07/2015 06:49 PM, Marek Polacek wrote:

> diff --git gcc/testsuite/g++.dg/cpp0x/pr68116.C gcc/testsuite/g++.dg/cpp0x/pr68116.C
> index e69de29..04ed901 100644
> --- gcc/testsuite/g++.dg/cpp0x/pr68116.C
> +++ gcc/testsuite/g++.dg/cpp0x/pr68116.C
> @@ -0,0 +1,12 @@
> +// PR c++/68116
> +// { dg-do compile { target c++11 } }
> +
> +class C {
> +  void foo ();
> +  typedef void (C::*T) (int);
> +  static T b[];
> +};
> +C::T C::b[]
> +{
> +  T (&C::foo)
> +};

The problem I have with approving C++ testcases is that I have no idea 
whether this is valid or not or what it expresses. You should Cc Jason 
(which I've now done).


Bernd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add testcase for c++/68116
  2015-12-08 11:54 ` Bernd Schmidt
@ 2015-12-08 14:15   ` Jason Merrill
  2015-12-08 14:21     ` Marek Polacek
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Merrill @ 2015-12-08 14:15 UTC (permalink / raw)
  To: Bernd Schmidt, Marek Polacek, GCC Patches

On 12/08/2015 06:54 AM, Bernd Schmidt wrote:
> On 12/07/2015 06:49 PM, Marek Polacek wrote:
>
>> diff --git gcc/testsuite/g++.dg/cpp0x/pr68116.C
>> gcc/testsuite/g++.dg/cpp0x/pr68116.C
>> index e69de29..04ed901 100644
>> --- gcc/testsuite/g++.dg/cpp0x/pr68116.C
>> +++ gcc/testsuite/g++.dg/cpp0x/pr68116.C
>> @@ -0,0 +1,12 @@
>> +// PR c++/68116
>> +// { dg-do compile { target c++11 } }
>> +
>> +class C {
>> +  void foo ();
>> +  typedef void (C::*T) (int);
>> +  static T b[];
>> +};
>> +C::T C::b[]
>> +{
>> +  T (&C::foo)
>> +};
>
> The problem I have with approving C++ testcases is that I have no idea
> whether this is valid or not or what it expresses. You should Cc Jason
> (which I've now done).

That's odd code--I don't approve of the cast in the initializer--but it 
is well-formed.  OK.

Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add testcase for c++/68116
  2015-12-08 14:15   ` Jason Merrill
@ 2015-12-08 14:21     ` Marek Polacek
  2015-12-08 14:37       ` Bernd Schmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Polacek @ 2015-12-08 14:21 UTC (permalink / raw)
  To: Jason Merrill; +Cc: Bernd Schmidt, GCC Patches

On Tue, Dec 08, 2015 at 09:15:33AM -0500, Jason Merrill wrote:
> On 12/08/2015 06:54 AM, Bernd Schmidt wrote:
> >On 12/07/2015 06:49 PM, Marek Polacek wrote:
> >
> >>diff --git gcc/testsuite/g++.dg/cpp0x/pr68116.C
> >>gcc/testsuite/g++.dg/cpp0x/pr68116.C
> >>index e69de29..04ed901 100644
> >>--- gcc/testsuite/g++.dg/cpp0x/pr68116.C
> >>+++ gcc/testsuite/g++.dg/cpp0x/pr68116.C
> >>@@ -0,0 +1,12 @@
> >>+// PR c++/68116
> >>+// { dg-do compile { target c++11 } }
> >>+
> >>+class C {
> >>+  void foo ();
> >>+  typedef void (C::*T) (int);
> >>+  static T b[];
> >>+};
> >>+C::T C::b[]
> >>+{
> >>+  T (&C::foo)
> >>+};
> >
> >The problem I have with approving C++ testcases is that I have no idea
> >whether this is valid or not or what it expresses. You should Cc Jason
> >(which I've now done).
> 
> That's odd code--I don't approve of the cast in the initializer--but it is
> well-formed.  OK.

Certainly we shouldn't ICE on this, as we used to, which is what I'm trying to
ensure here.  The code looks weird indeed, but it's C++... ;)

Thanks,

	Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add testcase for c++/68116
  2015-12-08 14:21     ` Marek Polacek
@ 2015-12-08 14:37       ` Bernd Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: Bernd Schmidt @ 2015-12-08 14:37 UTC (permalink / raw)
  To: Marek Polacek, Jason Merrill; +Cc: GCC Patches

On 12/08/2015 03:21 PM, Marek Polacek wrote:
>>>> +C::T C::b[]
>>>> +{
>>>> +  T (&C::foo)
>>>> +};
>>>
>>> The problem I have with approving C++ testcases is that I have no idea
>>> whether this is valid or not or what it expresses. You should Cc Jason
>>> (which I've now done).
>>
>> That's odd code--I don't approve of the cast in the initializer--but it is
>> well-formed.  OK.

For all the other people who were clueless like me, apparently this is a 
thing called "list initialization" or "brace-init" that you can google for.


Bernd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-08 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 17:49 [PATCH] Add testcase for c++/68116 Marek Polacek
2015-12-08 11:54 ` Bernd Schmidt
2015-12-08 14:15   ` Jason Merrill
2015-12-08 14:21     ` Marek Polacek
2015-12-08 14:37       ` Bernd Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).