summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/mangle37.C
blob: 7270861ac5c8137167168a63a1630ee50e42d74b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Testcase for mangling of expressions involving operator names.
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "_Z1fI1AEDTclonplfp_fp_EET_" } }
// { dg-final { scan-assembler "_Z1gI1AEDTclonplIT_Efp_fp_EES1_" } }
// { dg-final { scan-assembler "_Z1hI1AEDTcldtfp_miEET_" } }
// { dg-final { scan-assembler "_Z1iI1AEDTcldtfp_srT_miEES1_" } }
// { dg-final { scan-assembler "_Z1jI1AEDTcldtfp_cvPT_EES1_" } }

struct A {
  void operator-();
  template <class T>
  operator T();
};
template <class T>
T operator+(T,T);

template <class T>
auto f (T t) -> decltype(operator+(t,t));
template <class T>
auto g (T t) -> decltype(operator+<T>(t,t));
template <class T>
auto h (T t) -> decltype(t.operator-());
template <class T>
auto i (T t) -> decltype(t.T::operator-());
template <class T>
auto j (T t) -> decltype(t.operator T*());

int main()
{
  f(A());
  g(A());
  h(A());
  i(A());
  j(A());
}