view gcc/testsuite/g++.dg/cpp0x/auto14.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// 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;
}