aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C
new file mode 100644
index 0000000..0ada265
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C
@@ -0,0 +1,28 @@
+// PR c++/40306, c++/40307
+// { dg-do run { target c++11 } }
+
+template< typename T >
+struct test {
+ test run() {
+ auto tmp = *this;
+ return tmp;
+ }
+ test run_pass() {
+ test tmp( *this );
+ return tmp;
+ }
+
+ test run_fail() {
+ auto tmp( *this );
+ return tmp;
+ }
+};
+
+int main()
+{
+ test<int> x;
+ x.run();
+ x.run_pass();
+ x.run_fail();
+ return 0;
+}