Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / member5.C
blobba6a9705bee7ea6d044ef23f2dbc052b2456ce5f
1 // { dg-do compile }
2 // Contributed by: <fasbjx at free dot fr>
3 // PR c++/14389: Disambiguate overloaded member templates which differ only
4 //  in the template argument list.
6 namespace N1 {
8 struct S { 
9     template< typename B, typename A > void foo(); 
10     template< typename A >             void foo(); 
11 }; 
13 template< typename A >             void S::foo() {} 
14 template< typename B, typename A > void S::foo() {} 
16 template void S::foo<void> (); 
17 template void S::foo<void,void> (); 
21 namespace N2 {
23 struct S { 
24   template< typename _A > void foo(); 
25   template< int _i >      void foo(); 
26 }; 
28 template< typename _A > void S::foo() {} 
30 template void S::foo< 0 >();    // { dg-error "no definition available" "no def" }
31                                 // { dg-message "instantiated" "instantiated" { target *-*-* } 30 }