re PR c++/84306 (Wrong overload selected with -std=c++17, explicit and {})
authorMarek Polacek <polacek@redhat.com>
Tue, 3 Jul 2018 14:25:38 +0000 (14:25 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 3 Jul 2018 14:25:38 +0000 (14:25 +0000)
PR c++/84306
* g++.dg/overload/conv-op3.C: New test.

From-SVN: r262345

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/overload/conv-op3.C [new file with mode: 0644]

index 9e6f966b9d5bd8da50ada42fec0367844f05e0af..a201b7e0251e9532f62a2ab387866c50b9712fda 100644 (file)
@@ -3,6 +3,9 @@
        PR middle-end/86202
        * gcc.dg/Wint-conversion-2.c: New test.
 
+       PR c++/84306
+       * g++.dg/overload/conv-op3.C: New test.
+
 2018-07-03  Richard Biener  <rguenther@suse.de>
 
        PR ipa/86389
diff --git a/gcc/testsuite/g++.dg/overload/conv-op3.C b/gcc/testsuite/g++.dg/overload/conv-op3.C
new file mode 100644 (file)
index 0000000..9d04a37
--- /dev/null
@@ -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};
+}