[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaTemplate / template-friend-definition-in-template.cpp
blobcfcf00b58b0263aff3ecd6d6d57772636fcf2b47
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 template <class F1> int foo1(F1 X1);
6 template <int A1> struct A {
7 template <class F2> friend int foo1(F2 X2) {
8 return A1;
12 template struct A<1>;
13 int main() {
14 foo1(1.0);
17 template <class F1> int foo2(F1 X1);
19 template <int A1> struct B {
20 template <class F2> friend int foo2(F2 X2) {
21 return A1;
25 template struct B<1>;
26 template int foo2<float>(float X1);