re PR c++/89315 (Cannot convert to std::initializer_list - fails with gcc9 works...
authorMarek Polacek <polacek@redhat.com>
Sun, 17 Feb 2019 17:25:27 +0000 (17:25 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Sun, 17 Feb 2019 17:25:27 +0000 (17:25 +0000)
PR c++/89315
* g++.dg/cpp0x/initlist114.C: New test.

From-SVN: r268971

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/initlist114.C [new file with mode: 0644]

index 9ee97dc38f70dec255682c3e7e3afd4d70541d4a..e128474dc9e10985298f21cd906c48e5f35082c2 100644 (file)
@@ -5,6 +5,9 @@
 
        * g++.old-deja/g++.robertl/eb82.C: Tweak dg-error.
 
+       PR c++/89315
+       * g++.dg/cpp0x/initlist114.C: New test.
+
 2019-02-16  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/88680
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist114.C b/gcc/testsuite/g++.dg/cpp0x/initlist114.C
new file mode 100644 (file)
index 0000000..ffd7fa9
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/89315
+// { dg-do compile { target c++11 } }
+
+#include <initializer_list>
+
+struct bar {
+    bar(std::initializer_list<int>, int = int());
+};
+
+struct i {
+    const bar & invitees;
+};
+
+template <typename = void> struct n {
+public:
+    void m_fn1() { i{{}}; }
+};
+
+struct o : n<> {
+    void p() { m_fn1(); }
+};