[llvm-bugs] [Bug 20717] assertion failure assigning to immutable generic lambda init-capture

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 2 04:17:26 PDT 2017


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

NODA, Kai <nodakai at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |nodakai at gmail.com

--- Comment #1 from NODA, Kai <nodakai at gmail.com> ---
As of today, clang trunk at 306691 can correctly reject the test case with
-std=c++14 or 1z:

/tmp/m.cpp:2:39: error: cannot assign to a variable captured by copy in a
non-mutable lambda
  auto x = [i = 0](auto n) { return i += n; }(1);
                                    ~ ^
/tmp/m.cpp:2:46: note: in instantiation of function template specialization
'main()::(anonymous class)::operator()<int>' requested here
  auto x = [i = 0](auto n) { return i += n; }(1);
                                             ^
1 error generated.

-- 
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/20170702/b9c04311/attachment.html>


More information about the llvm-bugs mailing list