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?