repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
lookup
/
using45.C
blob
c92b794d9c5099f009a2ba6c76cbe7c613df369d
1
// PR c++/30195
2
// { dg-do run }
3
4
template <class T>
5
struct A
6
{
7
int f(int) { return 0; }
8
int f(double) { return 1; }
9
int f(char) { return 2; }
10
};
11
12
template <class T>
13
struct B : A<T>
14
{
15
using A<T>::f;
16
int f(int) { return 3; }
17
};
18
19
int main()
20
{
21
B<int> b;
22
if( b.f( 42 ) != 3 )
23
__builtin_abort();
24
25
if( b.f( 3.14 ) != 1 )
26
__builtin_abort();
27
28
if( b.f( 'a' ) != 2 )
29
__builtin_abort();
30
31
if( b.A<int>::f( 42 ) != 0 )
32
__builtin_abort();
33
}