http://llvm.org/bugs/show_bug.cgi?id=21180
Bug ID: 21180
Summary: clang does not delete default-constructor of lambdas
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Clang compiles the following code without any complaints:
template<typename T>
void fun(T) {
T instance{};
(void) instance; //disable unused-warning
}
int main() {
fun([]{});
}
According to §5.1.2, sentence 20 in the C++14-standard:
“The closure type associated with a lambda-expression has a deleted (8.4.3)
default constructor […]”
which makes the above code ill-formed.
command-line: $ clang++ -Wall -Wextra -Wpedantic -std=c++11 main.cpp
version: $ clang++ --version
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
(btw: the version-filed when filing a bug-report currently does not offer to
select 3.5.)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs