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

Message ID 20180703141423.GE5927@redhat.com
State New
Headers show
Series
  • C++ PATCH to add a test for c++/84306
Related show

Commit Message

Marek Polacek July 3, 2018, 2:14 p.m.
This patch merely adds a test for an already fixed issue.

Tested on x86_64-linux, ok for trunk?

2018-07-03  Marek Polacek  <polacek@redhat.com>

	PR c++/84306
	* g++.dg/overload/conv-op3.C: New test.

Comments

Jason Merrill July 3, 2018, 2:18 p.m. | #1
OK.

On Tue, Jul 3, 2018 at 10:14 AM, Marek Polacek <polacek@redhat.com> wrote:
> This patch merely adds a test for an already fixed issue.

>

> Tested on x86_64-linux, ok for trunk?

>

> 2018-07-03  Marek Polacek  <polacek@redhat.com>

>

>         PR c++/84306

>         * g++.dg/overload/conv-op3.C: New test.

>

> diff --git gcc/testsuite/g++.dg/overload/conv-op3.C gcc/testsuite/g++.dg/overload/conv-op3.C

> index e69de29bb2d..9d04a37fe5e 100644

> --- gcc/testsuite/g++.dg/overload/conv-op3.C

> +++ gcc/testsuite/g++.dg/overload/conv-op3.C

> @@ -0,0 +1,18 @@

> +// c++/84306

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

> +

> +struct foo {

> +  foo() = default;

> +

> +  foo(foo const&);

> +

> +  template<typename T>

> +  explicit foo(T&&) { }

> +};

> +

> +int

> +main()

> +{

> +  foo f1;

> +  foo f2{f1};

> +}

Patch

diff --git gcc/testsuite/g++.dg/overload/conv-op3.C gcc/testsuite/g++.dg/overload/conv-op3.C
index e69de29bb2d..9d04a37fe5e 100644
--- gcc/testsuite/g++.dg/overload/conv-op3.C
+++ gcc/testsuite/g++.dg/overload/conv-op3.C
@@ -0,0 +1,18 @@ 
+// c++/84306
+// { dg-do link { target c++11 } }
+
+struct foo {
+  foo() = default;
+
+  foo(foo const&);
+
+  template<typename T>
+  explicit foo(T&&) { }
+};
+
+int
+main()
+{
+  foo f1;
+  foo f2{f1};
+}