[C++] Added test for c++/87250

Message ID CAOrE4X0ZdEF=FuhT_92thZ-hRmVPswq41R4dhxgijZjZb14e=A@mail.gmail.com
State New
Headers show
Series
  • [C++] Added test for c++/87250
Related show

Commit Message

Matthew Beliveau June 10, 2019, 8:27 p.m.
My test is the result of reducing a file with just "include <atomic>",
just like in the PR.

It was fixed in r269059 which added a similar test, except mine does
not use inheritance and is a bit simpler. So I figured it wouldn't
hurt to cover more scenarios for this ICE.

I ran the test in my build directory and received 4 passes and 1
unsupported test, which was expected.

Comments

Marek Polacek June 10, 2019, 8:35 p.m. | #1
On Mon, Jun 10, 2019 at 04:27:32PM -0400, Matthew Beliveau wrote:
> My test is the result of reducing a file with just "include <atomic>",

> just like in the PR.

> 

> It was fixed in r269059 which added a similar test, except mine does

> not use inheritance and is a bit simpler. So I figured it wouldn't

> hurt to cover more scenarios for this ICE.

> 

> I ran the test in my build directory and received 4 passes and 1

> unsupported test, which was expected.


> Bootstrapped/regtested on x86_64-linux, ok for trunk?

> 

> 2019-06-10  Matthew Beliveau  <mbelivea@redhat.com>

> 	PR c++/87250

> 	* g++.dg/cpp0x/pr87250.C: New test.


For future reference: there should be a blank line after the first line.

> diff --git gcc/testsuite/g++.dg/cpp0x/pr87250.C gcc/testsuite/g++.dg/cpp0x/pr87250.C

> new file mode 100644

> index 00000000000..fe4bf1407de

> --- /dev/null

> +++ gcc/testsuite/g++.dg/cpp0x/pr87250.C

> @@ -0,0 +1,12 @@

> +// PR c++/87250

> +// { dg-do compile { target c++11 } }

> +// { dg-options "-Os -fsyntax-only" }

> +

> +template <typename> struct a {

> +  constexpr a(int) {}

> +};

> +template <typename> struct atomic;

> +template <> struct atomic<bool> {

> +  a<bool> b;

> +  constexpr atomic(bool c) : b(c) {}

> +};


Thanks, applied.

Marek

Patch

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2019-06-10  Matthew Beliveau  <mbelivea@redhat.com>
	PR c++/87250
	* g++.dg/cpp0x/pr87250.C: New test.

diff --git gcc/testsuite/g++.dg/cpp0x/pr87250.C gcc/testsuite/g++.dg/cpp0x/pr87250.C
new file mode 100644
index 00000000000..fe4bf1407de
--- /dev/null
+++ gcc/testsuite/g++.dg/cpp0x/pr87250.C
@@ -0,0 +1,12 @@ 
+// PR c++/87250
+// { dg-do compile { target c++11 } }
+// { dg-options "-Os -fsyntax-only" }
+
+template <typename> struct a {
+  constexpr a(int) {}
+};
+template <typename> struct atomic;
+template <> struct atomic<bool> {
+  a<bool> b;
+  constexpr atomic(bool c) : b(c) {}
+};