<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang does not delete default-constructor of lambdas"
   href="http://llvm.org/bugs/show_bug.cgi?id=21180">21180</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang does not delete default-constructor of lambdas
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>florian.weber@sfz-bw.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>