[LLVMbugs] [Bug 21180] New: clang does not delete default-constructor of lambdas

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 6 19:21:53 PDT 2014


            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: unassignedclangbugs at nondot.org
          Reporter: florian.weber at sfz-bw.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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() {

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141007/57e6bc9a/attachment.html>

More information about the llvm-bugs mailing list