[all-commits] [llvm/llvm-project] 15e772: Don't instantiate lambda closure types in default ...

Richard Smith via All-commits all-commits at lists.llvm.org
Tue Oct 20 17:37:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 15e772e8dc39f609115430f39078fbe58812fddb
      https://github.com/llvm/llvm-project/commit/15e772e8dc39f609115430f39078fbe58812fddb
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-10-20 (Tue, 20 Oct 2020)

  Changed paths:
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/SemaTemplate/explicit-instantiation.cpp
    M clang/test/SemaTemplate/instantiate-local-class.cpp

  Log Message:
  -----------
  Don't instantiate lambda closure types in default member initializers
when instantiating the enclosing class.

We'll build new lambda closure types if and when we instantiate the
default member initializer, and instantiating the closure type by itself
can go wrong in cases where we fully-instantiate nested classes (in
explicit instantiations of the enclosing class and when the enclosing
class is a local class) -- we will instantiate the 'operator()' as a
regular function rather than as a lambda call operator, so it doesn't
get to use its captures, has the wrong 'this' type, etc.




More information about the All-commits mailing list