URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [defaulted13.C] - Rev 839
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