diff options
Diffstat (limited to 'test/SemaCXX/cxx1y-init-captures.cpp')
-rw-r--r-- | test/SemaCXX/cxx1y-init-captures.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/SemaCXX/cxx1y-init-captures.cpp b/test/SemaCXX/cxx1y-init-captures.cpp index 64fe50a70e78..203e28d7c3f9 100644 --- a/test/SemaCXX/cxx1y-init-captures.cpp +++ b/test/SemaCXX/cxx1y-init-captures.cpp @@ -166,4 +166,27 @@ int test(T t = T{}) { int run = test(); //expected-note {{instantiation}} -}
\ No newline at end of file +} + +namespace classification_of_captures_of_init_captures { + +template <typename T> +void f() { + [a = 24] () mutable { + [&a] { a = 3; }(); + }(); +} + +template <typename T> +void h() { + [a = 24] (auto param) mutable { + [&a] { a = 3; }(); + }(42); +} + +int run() { + f<int>(); + h<int>(); +} + +} |