aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C
new file mode 100644
index 000000000..d85918dd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C
@@ -0,0 +1,30 @@
+// PR c++/58083
+// { dg-do compile { target c++11 } }
+
+namespace details {
+struct iterator_concept_checker
+{
+ typedef char yes_type;
+ typedef char (&no_type)[2];
+
+ template <typename T>
+ static no_type test(...);
+
+ template <typename T>
+ static yes_type test(
+ int*
+ , void (*)(T) = [](T it)
+ {
+ auto copy = T{it}; // copy constructible
+ copy = it; // copy assignable
+ copy.~T(); // destroyable
+ ++it; // incrementable
+ }
+ );
+};
+}
+
+int main()
+{
+ details::iterator_concept_checker::test<int>(0);
+}