re PR c++/50025 ([DR 1288] C++0x initialization syntax doesn't work for class members...
authorEdward Smith-Rowland <3dw4rd@verizon.net>
Sat, 1 Mar 2014 22:51:25 +0000 (22:51 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Sat, 1 Mar 2014 22:51:25 +0000 (22:51 +0000)
2014-03-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

PR c++/50025
* g++.dg/cpp0x/pr50025.C: New.

From-SVN: r208251

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

index 2f05638..2788b7d 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-01  Edward Smith-Rowland  <3dw4rd@verizon.net>
+
+       PR c++/50025
+       * g++.dg/cpp0x/pr50025.C: New.
+
 2014-03-01  Adam Butcher  <adam@jessamine.co.uk>
 
        PR c++/60377
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr50025.C b/gcc/testsuite/g++.dg/cpp0x/pr50025.C
new file mode 100644 (file)
index 0000000..7232463
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++11" }
+
+#include <utility>
+
+class A
+{
+public:
+
+  A(int a, int& b, int&& c)
+  : m_a{a},
+    m_b{b},
+    m_c{std::move(c)}
+  {}
+
+private:
+
+  int m_a;
+  int& m_b;
+  int&& m_c;
+};
+
+
+struct X {};
+
+class B
+{
+public:
+
+  B(X& q, X&& r, const X& s)
+  : m_q{q},
+    m_r{std::move(r)},
+    m_s{s}
+  {}
+
+private:
+
+  X& m_q;
+  X&& m_r;
+  const X& m_s;
+};