[C++ PATCH] Added test for c++/87250
Marek Polacek
polacek@redhat.com
Mon Jun 10 20:35:00 GMT 2019
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
More information about the Gcc-patches
mailing list