Debian Codegraph @

gcc/testsuite/g++.dg/template/using2.C

raw
1 // { dg-do compile }
2
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 22 Jul 2003 <[email protected]>
5
6 // PR 9447. Using decls in template classes.
7
8 template <class T>
9 struct Foo {
10 int i;
11 };
12
13 struct Baz
14 {
15 int i;
16 };
17
18 template <class T>
19 struct Bar : public Foo<T>, Baz
20 {
21 using Foo<T>::i; // { dg-message "previous declaration" }
22 using Baz::i; // { dg-error "redeclaration" }
23
24 int foo () { return i; }
25 };
26
27 void foo (Bar<int> &bar)
28 {
29 bar.foo();
30 }
31