URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [defaulted13.C] - Rev 701
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 "declared" }
template<typename T>
NonCopyable<T>::NonCopyable(NonCopyable<T> const&) = default;
template<>
NonCopyable<double>::NonCopyable(NonCopyable<double> const&) = delete; // { dg-error "declared" }
int main()
{
NonCopyable<double> nc_dbl;
NonCopyable<double> nc_dbl_cpy(nc_dbl); // { dg-error "use" }
NonCopyable<int> nc_int;
NonCopyable<int> nc_int_cpy(nc_int); // { dg-error "use" }
NonCopyable<char> nc_char;
NonCopyable<char> nc_char_cpy(nc_char);
}
Go to most recent revision | Compare with Previous | Blame | View Log