diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-17 04:02:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-17 04:02:59 +0000 |
commit | bd64520ca4e4d4c531637d311f8ea384c912fce8 (patch) | |
tree | 22c54e052513fab28aa3342fbb4c1fd5078af80f /test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp | |
parent | b3f323d6c41cb614a249dbc4af7493762786521a (diff) |
Only add 'const' to the type of variables captured in a lambda when
we're capturing it by value in a non-mutable lambda.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp index 561ead1271..03cbe32ef4 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp @@ -38,4 +38,8 @@ void f3() { "should be const float&"); }(); }(); + + [&i] { + static_assert(is_same<decltype((i)), int&>::value, "should be int&"); + }(); } |