2017-09-13 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-defarg5.C
blobd85918dd07bee1582d562f682835d93adde53f11
1 // PR c++/58083
2 // { dg-do compile { target c++11 } }
4 namespace details {
5 struct iterator_concept_checker
7     typedef char yes_type;
8     typedef char (&no_type)[2];
10     template <typename T>
11     static no_type test(...);
13     template <typename T>
14     static yes_type test(
15         int*
16         , void (*)(T) = [](T it)
17         {
18             auto copy = T{it};                              // copy constructible
19             copy = it;                                      // copy assignable
20             copy.~T();                                      // destroyable
21             ++it;                                           // incrementable
22         }
23       );
27 int main()
29   details::iterator_concept_checker::test<int>(0);