URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [defaulted13.C] - Rev 378
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-options -std=c++0x }
template<typename T>
struct NonCopyable {
NonCopyable() = default;
NonCopyable(NonCopyable const&);
};
template<>
NonCopyable<int>::NonCopyable(NonCopyable<int> const&) = delete; // { dg-error "deleted" }
template<typename T>
NonCopyable<T>::NonCopyable(NonCopyable<T> const&) = default;
template<>
NonCopyable<double>::NonCopyable(NonCopyable<double> const&) = delete; // { dg-error "deleted" }
int main()
{
NonCopyable<double> nc_dbl;
NonCopyable<double> nc_dbl_cpy(nc_dbl); // { dg-error "used here" }
NonCopyable<int> nc_int;
NonCopyable<int> nc_int_cpy(nc_int); // { dg-error "used here" }
NonCopyable<char> nc_char;
NonCopyable<char> nc_char_cpy(nc_char);
}
Go to most recent revision | Compare with Previous | Blame | View Log