[all-commits] [llvm/llvm-project] 79f9cf: Do not merge LocalInstantiationScope for template ...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Mon Jun 14 20:39:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 79f9cfbc21e02555258523ea77c3dd389891cfb3
      https://github.com/llvm/llvm-project/commit/79f9cfbc21e02555258523ea77c3dd389891cfb3
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2021-06-14 (Mon, 14 Jun 2021)

  Changed paths:
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    A clang/test/SemaCXX/recursive-lambda.cpp

  Log Message:
  -----------
  Do not merge LocalInstantiationScope for template specialization

A lambda in a function template may be recursively instantiated. The recursive
lambda will cause a lambda function instantiated multiple times, one inside another.
The inner LocalInstantiationScope should not be marked as MergeWithParentScope
since it already has references to locals properly substituted, otherwise it causes
assertion due to the check for duplicate locals in merged LocalInstantiationScope.

Reviewed by: Richard Smith

Differential Revision: https://reviews.llvm.org/D98068




More information about the All-commits mailing list