aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/paren1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp1y/paren1.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp1y/paren1.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/paren1.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/paren1.C
new file mode 100644
index 000000000..809f25100
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/paren1.C
@@ -0,0 +1,31 @@
+// PR c++/63437
+// { dg-do compile { target c++11 } }
+
+struct X // movable but not copyable
+{
+ X() = default;
+ X(X &&) = default;
+
+ X(const X &) = delete;
+};
+
+X non_parenthesized()
+{
+ X x;
+ return x; // works
+}
+
+X parenthesized()
+{
+ X x;
+ return (x); // error: use of deleted function 'X::X(const X&)'
+}
+
+template <class T>
+T parenthesized_t()
+{
+ T t;
+ return (t);
+}
+
+template X parenthesized_t<X>();