OSDN Git Service

* pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / defaulted13.C
1 // { dg-options -std=c++0x }
2
3 template<typename T>
4 struct NonCopyable {
5   NonCopyable() = default;
6   NonCopyable(NonCopyable const&);
7 };
8
9 template<>
10 NonCopyable<int>::NonCopyable(NonCopyable<int> const&) = delete; // { dg-error "deleted" }
11
12 template<typename T>
13 NonCopyable<T>::NonCopyable(NonCopyable<T> const&) = default;
14
15 template<>
16 NonCopyable<double>::NonCopyable(NonCopyable<double> const&) = delete; // { dg-error "deleted" }
17
18
19 int main()
20 {
21   NonCopyable<double> nc_dbl;
22   NonCopyable<double> nc_dbl_cpy(nc_dbl); // { dg-error "used here" }
23
24   NonCopyable<int> nc_int;
25   NonCopyable<int> nc_int_cpy(nc_int); // { dg-error "used here" }
26
27   NonCopyable<char> nc_char;
28   NonCopyable<char> nc_char_cpy(nc_char);
29 }