[all-commits] [llvm/llvm-project] cde8d2: Fix miscompile when performing template instantiat...

Richard Smith via All-commits all-commits at lists.llvm.org
Wed Feb 3 23:38:36 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cde8d2fddbff55cae520d90f47f6faf124d3f953
      https://github.com/llvm/llvm-project/commit/cde8d2fddbff55cae520d90f47f6faf124d3f953
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-02-03 (Wed, 03 Feb 2021)

  Changed paths:
    M clang/lib/Sema/TreeTransform.h
    A clang/test/CodeGenCXX/instantiate-init.cpp

  Log Message:
  -----------
  Fix miscompile when performing template instantiation of non-dependent
doubly-nested implicit CXXConstructExprs.

Ensure that we transform the parameter initializer using
TransformInitializer rather than TransformExpr so that we properly strip
down and rebuild the initialization, including any necessary
CXXBindTemporaryExprs. Otherwise we can end up forgetting to destroy
temporary objects used to construct a constructor parameter.




More information about the All-commits mailing list