diff options
Diffstat (limited to 'test/SemaCXX/lambda-expressions.cpp')
-rw-r--r-- | test/SemaCXX/lambda-expressions.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp index 99fc0caaf7..80ba0a1d03 100644 --- a/test/SemaCXX/lambda-expressions.cpp +++ b/test/SemaCXX/lambda-expressions.cpp @@ -139,3 +139,12 @@ void PR12248() unsigned int result = 0; auto l = [&]() { ++result; }; } + +namespace ModifyingCapture { + void test() { + int n = 0; + [=] { + n = 1; // expected-error {{variable is not assignable (captured by copy)}} + }; + } +} |