c++: add original testcase [PR67898]
Checks
Commit Message
Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
-- >8 --
The original testcase from this PR (fixed by r14-8291) is rather
different from the others, so let's add it to the testsuite.
PR c++/67898
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/temp_default8.C: New test.
---
gcc/testsuite/g++.dg/cpp0x/temp_default8.C | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/cpp0x/temp_default8.C
Comments
On 1/30/24 12:14, Patrick Palka wrote:
> Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
OK.
> -- >8 --
>
> The original testcase from this PR (fixed by r14-8291) is rather
> different from the others, so let's add it to the testsuite.
>
> PR c++/67898
>
> gcc/testsuite/ChangeLog:
>
> * g++.dg/cpp0x/temp_default8.C: New test.
> ---
> gcc/testsuite/g++.dg/cpp0x/temp_default8.C | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> create mode 100644 gcc/testsuite/g++.dg/cpp0x/temp_default8.C
>
> diff --git a/gcc/testsuite/g++.dg/cpp0x/temp_default8.C b/gcc/testsuite/g++.dg/cpp0x/temp_default8.C
> new file mode 100644
> index 00000000000..505c67d7c41
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/cpp0x/temp_default8.C
> @@ -0,0 +1,14 @@
> +// PR c++/67898
> +// { dg-do compile { target c++11 } }
> +
> +void f(int);
> +void f(float);
> +
> +template<class T, T F, T G, bool b = F == G> struct X { };
> +
> +template<class T>
> +void test() {
> + X<void(T), f, f>();
> +}
> +
> +template void test<int>();
new file mode 100644
@@ -0,0 +1,14 @@
+// PR c++/67898
+// { dg-do compile { target c++11 } }
+
+void f(int);
+void f(float);
+
+template<class T, T F, T G, bool b = F == G> struct X { };
+
+template<class T>
+void test() {
+ X<void(T), f, f>();
+}
+
+template void test<int>();