<html>
    <head>
      <base href="https://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 --- - Assertion with typo correction with invalid lambda and template instantiation" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24175&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=G3OPobea9C3RY4qv7Lzgjt-yQAlu3nPbvPL0wEA4J5A&s=-8SKf0z7FxYQRzbhvSuPbIc0HF8IJdp9xPgqZr5HPmU&e=">24175</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion with typo correction with invalid lambda and template instantiation
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rtrieu@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Typo correction is not marking some types as invalid causing Clang to assert
when trying to take the size of an invalid type during template instantiation.

clang -fsyntax-only -std=c++11 run.cpp 
run.cpp:32:23: error: call to deleted constructor of 'DeletedCopy'
  auto some_lambda = [DC]() {};
                      ^~
run.cpp:27:3: note: 'DeletedCopy' has been explicitly marked deleted here
  DeletedCopy(const DeletedCopy&) = delete;
  ^
run.cpp:33:27: error: use of undeclared identifier 'some_lambda2'; did you mean
      'some_lambda'?
  Wrapper<void()> A = Run(some_lambda2);
                          ^~~~~~~~~~~~
                          some_lambda
run.cpp:32:8: note: 'some_lambda' declared here
  auto some_lambda = [DC]() {};
       ^

clang-3.5: ../tools/clang/lib/AST/ASTContext.cpp:1733: clang::TypeInfo
clang::ASTContext::getTypeInfoImpl(const clang::Type *) const: Assertion
`!A->getDeducedType().isNull() && "cannot request the size of an undeduced or
dependent auto type"' failed.

1.    <eof> parser at end of file
2.    run.cpp:9:3: instantiating function definition 'operator Wrapper'
clang-3.5: error: unable to execute command: Aborted (core dumped)
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)

run.cpp:
template <typename F>
struct Wrapper {};

template <typename Impl>
struct Outer {
  explicit Outer(const Impl& impl) {}

  template <typename F>
  operator Wrapper<F>() const {
    return new Inner<F>(impl_);
  }

  template <typename F>
  struct Inner : public Wrapper<F> {
    explicit Inner(const Impl& impl) {}
    Impl impl_;
  };

  Impl impl_;
};

template <typename FunctionImpl>
Outer<FunctionImpl> Run(FunctionImpl) {}

struct DeletedCopy {
  DeletedCopy();
  DeletedCopy(const DeletedCopy&) = delete;
};

void Test() {
  DeletedCopy DC;
  auto some_lambda = [DC]() {};
  Wrapper<void()> A = Run(some_lambda2);
}</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>