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 | 7ae3c75d97e46c56b7b40290381e0e4ef0c9125f (patch) | |
tree | 6b41462243b62ef9083df656dcceea3c99baf84e /clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp | |
parent | a80cae11f6cdbc92b0a5c47c454534ac564452d3 (diff) | |
download | bcm5719-llvm-7ae3c75d97e46c56b7b40290381e0e4ef0c9125f.tar.gz bcm5719-llvm-7ae3c75d97e46c56b7b40290381e0e4ef0c9125f.zip |
Only add 'const' to the type of variables captured in a lambda when
we're capturing it by value in a non-mutable lambda.
llvm-svn: 150791
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp index 561ead1271e..03cbe32ef4e 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp +++ b/clang/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&"); + }(); } |