summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/koenig5.C
blob: d54bb75430c5f9f5299011afc5376380192e76c2 (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
// { dg-do compile }
// Contributed by David Abrahams <dave at boost-consulting dot com>
// PR c++/14143: Koenig lookup should only look into template arguments only 
//  if the argument is a template-id.

namespace fu
{
  template <class T>
  struct bar
  {
      struct baz {};
  };
}

namespace axe
{
  struct handle {};
  
  template <class T>
  char* f(T&);
}

namespace test
{
  template <class T>
  int f(T const&);
  
  template <class T>
  int g(T x) { return f(x); }
  
  int x = g(fu::bar<axe::handle>::baz());
}