C++ PATCH to add a test for c++/82231

Message ID 20171219115609.GO2605@redhat.com
State New
Headers show
Series
  • C++ PATCH to add a test for c++/82231
Related show

Commit Message

Marek Polacek Dec. 19, 2017, 11:56 a.m.
This bug was fixed in r255430, but the test looks different enough so we better
add it.

Tested on x86_64-linux, ok for trunk?

2017-12-19  Marek Polacek  <polacek@redhat.com>

	PR c++/82231
	* g++.dg/cpp1z/nontype-auto14.C: New test.


	Marek

Comments

Jason Merrill Dec. 19, 2017, 7:42 p.m. | #1
OK.

On Tue, Dec 19, 2017 at 6:56 AM, Marek Polacek <polacek@redhat.com> wrote:
> This bug was fixed in r255430, but the test looks different enough so we better

> add it.

>

> Tested on x86_64-linux, ok for trunk?

>

> 2017-12-19  Marek Polacek  <polacek@redhat.com>

>

>         PR c++/82231

>         * g++.dg/cpp1z/nontype-auto14.C: New test.

>

> --- gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C

> +++ gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C

> @@ -0,0 +1,14 @@

> +// PR c++/82231

> +// { dg-options -std=c++17 }

> +

> +template<int>

> +struct x {};

> +

> +template <auto I, decltype(I) X>

> +void f(x<X>) { }

> +

> +int

> +main()

> +{

> +  f<0>(x<1>{});

> +}

>

>         Marek

Patch

--- gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C
+++ gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C
@@ -0,0 +1,14 @@ 
+// PR c++/82231
+// { dg-options -std=c++17 }
+
+template<int>
+struct x {};
+
+template <auto I, decltype(I) X>
+void f(x<X>) { }
+
+int
+main()
+{
+  f<0>(x<1>{});
+}