[llvm-bugs] [Bug 39963] Structured binding declaration & closure does not work

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 11 11:58:57 PST 2018


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |LATER
             Status|NEW                         |RESOLVED

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
I'm sorry, this would be a very reasonable feature and I'm sure it will be part
of C++ at some point, but so far it's not valid C++. Discussion in the C++
committee got hung up on whether the entire pair would be captured in this
case, or only the named binding. GCC has jumped the gun and implemented
something speculative here.

In the mean time, you can work around this using an init-capture:

  ([i=i](){ return i; })();

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181211/97cadd0d/attachment.html>


More information about the llvm-bugs mailing list