aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/member5.C
blob: 0cdd52aea89a51aef60e030623604146a7f69ed0 (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
// { dg-do compile }
// Contributed by: <fasbjx at free dot fr>
// PR c++/14389: Disambiguate overloaded member templates which differ only
//  in the template argument list.

namespace N1 {

struct S { 
    template< typename B, typename A > void foo(); 
    template< typename A >             void foo(); 
}; 
 
template< typename A >             void S::foo() {} 
template< typename B, typename A > void S::foo() {} 
 
template void S::foo<void> (); 
template void S::foo<void,void> (); 

}

namespace N2 {

struct S { 
  template< typename _A > void foo(); 
  template< int _i >      void foo(); 
}; 

template< typename _A > void S::foo() {} 

template void S::foo< 0 >();    // { dg-error "no definition available" "no def" }
				// { dg-message "required" "instantiated" { target *-*-* } 30 }

}