aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/fn-template5.C
blob: 33477c967468e64798588516dcd500fa27bf069f (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
// P0846R0
// { dg-do run }
// { dg-options "-std=c++2a" }

int g() { return 11; }
int e() { return 12; }
int e(int) { return 13; }
int e(int, int) { return 14; }

namespace N {
  struct A { };
  template <class T> int f(T) { return 1; }
  template <class T> int g(T) { return 2; }
  template <class T> int e(T) { return 3; }
}

int
main ()
{
  int v = e(1);
  if (v != 13)
    __builtin_abort ();
  int x = e(1, 2);
  if (x != 14)
    __builtin_abort ();
  int y = g();
  if (y != 11)
    __builtin_abort ();
  int z = e();
  if (z != 12)
    __builtin_abort ();
}