[LLVMbugs] [Bug 23281] New: clang allows invalid code with lambda expression move-assignment
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Apr 18 13:14:55 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=23281
Bug ID: 23281
Summary: clang allows invalid code with lambda expression
move-assignment
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: ryan.burn at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
The following code compiles in clang++ 3.7 but is rejected by gcc and intel
compiler.
#include <utility>
int main() {
auto f = [](int x) { return 7*x; };
using T = decltype(f);
T h(f);
h = std::move(f);
return 0;
}
Also, the standard seems to disallow it:
http://eel.is/c++draft/expr.prim.lambda#20 – lambdas have deleted copy
assignment. Also, http://eel.is/c++draft/class.copy#20 says that means that
deleted copy assignment means there will be no move assignment.
--
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/20150418/378bc0af/attachment.html>
More information about the llvm-bugs
mailing list