[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaTemplate / operator-function-id-template.cpp
blob96dfe26cc59670375ec31deff4dd95c73dbe1ee8
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 template<typename T>
5 struct A {
6 template<typename U> A<T> operator+(U);
7 };
9 template<int Value, typename T> bool operator==(A<T>, A<T>);
11 template<> bool operator==<0>(A<int>, A<int>);
13 bool test_qualified_id(A<int> ai) {
14 return ::operator==<0, int>(ai, ai);
17 void test_op(A<int> a, int i) {
18 const A<int> &air = a.operator+<int>(i);
21 template<typename T>
22 void test_op_template(A<T> at, T x) {
23 const A<T> &atr = at.template operator+<T>(x);
24 const A<T> &atr2 = at.A::template operator+<T>(x);
25 // FIXME: unrelated template-name instantiation issue
26 // const A<T> &atr3 = at.template A<T>::template operator+<T>(x);
29 template void test_op_template<float>(A<float>, float);