diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-15 02:34:23 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-15 02:34:23 +0000 |
| commit | 1879f1069b607b5cb3a16a0500bcb25e871d3b23 (patch) | |
| tree | b10bbc4a902386968ddf26a938f1bdb88ecd07c0 /clang/test | |
| parent | 39a7c4c65afa08e620f14f52d5c67776c7f255f7 (diff) | |
| download | bcm5719-llvm-1879f1069b607b5cb3a16a0500bcb25e871d3b23.tar.gz bcm5719-llvm-1879f1069b607b5cb3a16a0500bcb25e871d3b23.zip | |
Disable lambda-capture of decomposition declaration bindings for now, until CWG
agrees on how they're supposed to work.
llvm-svn: 278648
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/cxx1z-decomposition.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1z-decomposition.cpp b/clang/test/SemaCXX/cxx1z-decomposition.cpp index 0ddd9ea3046..12c863c8c3f 100644 --- a/clang/test/SemaCXX/cxx1z-decomposition.cpp +++ b/clang/test/SemaCXX/cxx1z-decomposition.cpp @@ -37,4 +37,14 @@ constexpr bool g(S &&s) { } static_assert(g({1, 2})); +void enclosing() { + struct S { int a; }; + auto [n] = S(); // expected-note 2{{'n' declared here}} + + struct Q { int f() { return n; } }; // expected-error {{reference to local binding 'n' declared in enclosing function}} + // FIXME: This is probably supposed to be valid, but we do not have clear rules on how it's supposed to work. + (void) [&] { return n; }; // expected-error {{reference to local binding 'n' declared in enclosing function}} + (void) [n] {}; // expected-error {{'n' in capture list does not name a variable}} +} + // FIXME: by-value array copies |

