summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/mangle39.C
blob: 289635610659f6ee26d26cdde63d6665fdaf461a (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
// PR c++/42338
// { dg-options "-std=c++0x -fabi-version=5" }
// { dg-final { scan-assembler "_Z1fIPiEDTcmppfp_Li0EET_" } }
// { dg-final { scan-assembler "_Z1gIiEvRK1AIT_EDTixfL0p_Li0EE" } }

template<typename T>
auto f(T t) -> decltype(++t, 0)
{
  ++t;
  return 0;
}

template <class T>
struct A
{
  T operator[](int) const { return 0; }
};

template< typename T >
void g(const A<T> &a, decltype(a[0]) t) { }

int main()
{
  f((int*)0);

  A<int> a;
  g(a,1);
}