* [PATCH] Add testcase for c++/68348
@ 2015-12-09 15:38 Marek Polacek
2015-12-09 15:39 ` Kyrill Tkachov
0 siblings, 1 reply; 4+ messages in thread
From: Marek Polacek @ 2015-12-09 15:38 UTC (permalink / raw)
To: GCC Patches, Jason Merrill
This adds a testcase for the already fixed PR68348.
Tested on x86_64-linux, ok for trunk?
2015-12-09 Marek Polacek <polacek@redhat.com>
PR c++/68348
* g++.dg/cpp0x/pr68348.C: New test.
diff --git gcc/testsuite/g++.dg/cpp0x/pr68348.C gcc/testsuite/g++.dg/cpp0x/pr68348.C
index e69de29..9033bba 100644
--- gcc/testsuite/g++.dg/cpp0x/pr68348.C
+++ gcc/testsuite/g++.dg/cpp0x/pr68348.C
@@ -0,0 +1,18 @@
+// PR c++/68348
+// { dg-do compile { target c++11 } }
+
+struct C {
+ constexpr C() : w(), x(), y() {}
+ constexpr double fn() const noexcept;
+ double w;
+ double x;
+ double y;
+};
+
+constexpr double C::fn() const noexcept { return w; }
+C foo()
+{
+ C c;
+ c.fn ();
+ return c;
+}
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add testcase for c++/68348
2015-12-09 15:38 [PATCH] Add testcase for c++/68348 Marek Polacek
@ 2015-12-09 15:39 ` Kyrill Tkachov
2015-12-09 15:43 ` Marek Polacek
0 siblings, 1 reply; 4+ messages in thread
From: Kyrill Tkachov @ 2015-12-09 15:39 UTC (permalink / raw)
To: Marek Polacek, GCC Patches, Jason Merrill
On 09/12/15 15:38, Marek Polacek wrote:
> This adds a testcase for the already fixed PR68348.
>
> Tested on x86_64-linux, ok for trunk?
>
> 2015-12-09 Marek Polacek <polacek@redhat.com>
>
> PR c++/68348
> * g++.dg/cpp0x/pr68348.C: New test.
>
> diff --git gcc/testsuite/g++.dg/cpp0x/pr68348.C gcc/testsuite/g++.dg/cpp0x/pr68348.C
> index e69de29..9033bba 100644
> --- gcc/testsuite/g++.dg/cpp0x/pr68348.C
> +++ gcc/testsuite/g++.dg/cpp0x/pr68348.C
> @@ -0,0 +1,18 @@
> +// PR c++/68348
> +// { dg-do compile { target c++11 } }
> +
> +struct C {
> + constexpr C() : w(), x(), y() {}
> + constexpr double fn() const noexcept;
> + double w;
> + double x;
> + double y;
> +};
> +
> +constexpr double C::fn() const noexcept { return w; }
> +C foo()
> +{
> + C c;
> + c.fn ();
> + return c;
> +}
>
> Marek
>
Same as:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01001.html
:)
Kyrill
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add testcase for c++/68348
2015-12-09 15:39 ` Kyrill Tkachov
@ 2015-12-09 15:43 ` Marek Polacek
2015-12-10 15:17 ` Jason Merrill
0 siblings, 1 reply; 4+ messages in thread
From: Marek Polacek @ 2015-12-09 15:43 UTC (permalink / raw)
To: Kyrill Tkachov; +Cc: GCC Patches, Jason Merrill
On Wed, Dec 09, 2015 at 03:39:50PM +0000, Kyrill Tkachov wrote:
> On 09/12/15 15:38, Marek Polacek wrote:
> >This adds a testcase for the already fixed PR68348.
> >
> >Tested on x86_64-linux, ok for trunk?
> >
> >2015-12-09 Marek Polacek <polacek@redhat.com>
> >
> > PR c++/68348
> > * g++.dg/cpp0x/pr68348.C: New test.
> >
> >diff --git gcc/testsuite/g++.dg/cpp0x/pr68348.C gcc/testsuite/g++.dg/cpp0x/pr68348.C
> >index e69de29..9033bba 100644
> >--- gcc/testsuite/g++.dg/cpp0x/pr68348.C
> >+++ gcc/testsuite/g++.dg/cpp0x/pr68348.C
> >@@ -0,0 +1,18 @@
> >+// PR c++/68348
> >+// { dg-do compile { target c++11 } }
> >+
> >+struct C {
> >+ constexpr C() : w(), x(), y() {}
> >+ constexpr double fn() const noexcept;
> >+ double w;
> >+ double x;
> >+ double y;
> >+};
> >+
> >+constexpr double C::fn() const noexcept { return w; }
> >+C foo()
> >+{
> >+ C c;
> >+ c.fn ();
> >+ return c;
> >+}
> >
> > Marek
> >
>
> Same as:
> https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01001.html
> :)
Ah! The PR wasn't assigned to anyone. But I think my version is better
because I think we prefer
// { dg-do compile { target c++11 } }
to
/* { dg-options "-std=c++11 -O2" } */
;)
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-10 15:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 15:38 [PATCH] Add testcase for c++/68348 Marek Polacek
2015-12-09 15:39 ` Kyrill Tkachov
2015-12-09 15:43 ` Marek Polacek
2015-12-10 15:17 ` Jason Merrill
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).