brintos

brintos / llvm-project-archived public Read only

0
0
Text · 762 B · 96dfe26 Raw
30 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4template<typename T>5struct A { 6  template<typename U> A<T> operator+(U);7};8 9template<int Value, typename T> bool operator==(A<T>, A<T>);10 11template<> bool operator==<0>(A<int>, A<int>);12 13bool test_qualified_id(A<int> ai) {14  return ::operator==<0, int>(ai, ai);15}16 17void test_op(A<int> a, int i) {18  const A<int> &air = a.operator+<int>(i);19}20 21template<typename T>22void 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 issue26  //  const A<T> &atr3 = at.template A<T>::template operator+<T>(x);27}28 29template void test_op_template<float>(A<float>, float);30