https://bugs.llvm.org/show_bug.cgi?id=35984

            Bug ID: 35984
           Summary: Failure to capture variable from structured binding
           Product: new-bugs
           Version: 5.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: svalor...@gmail.com
                CC: llvm-bugs@lists.llvm.org

```
#include <tuple>

std::tuple<int, double> a() { return std::make_tuple(0, 0.4); }

int main() {
    auto [x, y] = a();
    const auto q = [x](){ return true; };
    return 0;
}
```

This fails to compile with 

7 : <source>:7:21: error: 'x' in capture list does not name a variable
    const auto q = [x](){ return true; };

This breaks on my machine with clang++ 4.0. I have also tested this on clang++
5.0 on godbolt.org.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to