This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Dependent base class and CVS head
- From: Roberto Bagnara <bagnara at cs dot unipr dot it>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Jul 2003 22:25:36 +0200
- Subject: Dependent base class and CVS head
- Organization: Department of Mathematics, University of Parma, Italy
The attached snippet is compiled fine (in the respective
"pedantic" modes) by G++ 3.3, by Comeau C++ 4.3.0.1,
and by the latest patch version of Intel's C++ compiler 7.1.
However G++ "gcc version 3.4 20030714 (experimental)"
gives
test2.cc: In member function `void D<T>::foo()':
test2.cc:16: error: `i' undeclared (first use this function)
test2.cc:16: error: (Each undeclared identifier is reported only once for each
function it appears in.)
test2.cc:17: error: there are no arguments to `bar' that depend on a template
parameter, so a declaration of `bar' must be available
test2.cc:17: error: (if you use `-fpermissive', G++ will accept your code, but
allowing the use of an undeclared name is deprecated)
Who is right?
Cheers
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it
template <typename T>
class B {
public:
int i;
void bar() {
}
};
template <typename T>
class D : public B<T> {
public:
using B<T>::i;
using B<T>::bar;
void foo() {
i = 1;
bar();
}
};