[all-commits] [llvm/llvm-project] 921b45: [Sema]Select correct lexical context during templa...

Congcong Cai via All-commits all-commits at lists.llvm.org
Wed Apr 26 15:30:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 921b45a855f09afe99ea9c0c173794ee4ccd5872
      https://github.com/llvm/llvm-project/commit/921b45a855f09afe99ea9c0c173794ee4ccd5872
  Author: Congcong Cai <congcongcai0907 at 163.com>
  Date:   2023-04-27 (Thu, 27 Apr 2023)

  Changed paths:
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    A clang/test/SemaTemplate/template-friend-definition-in-template.cpp

  Log Message:
  -----------
  [Sema]Select correct lexical context during template instantiate

This patch wants to fix inline friend decl like
```
template <class F1> int foo(F1 X);
template <int A1> struct A {
  template <class F1> friend int foo(F1 X) { return A1; }
};

template struct A<1>;
int a = foo(1.0);
```

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




More information about the All-commits mailing list