1// { dg-do compile } 2 3// Copyright (C) 2003 Free Software Foundation, Inc. 4// Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com> 5 6// PR 9447. Using decls in template classes. 7 8template <class T> 9struct Foo { 10 int i; 11}; 12 13struct Baz 14{ 15 int i; 16}; 17 18template <class T> 19struct 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 27void foo (Bar<int> &bar) 28{ 29 bar.foo(); 30} 31 32