This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: PR 11493 and PR 11495
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Jul 2003 14:55:44 +0200 (CEST)
- Subject: Re: C++ PATCH: PR 11493 and PR 11495
(First, late me state that I really appreciate the huge number of fixes
and improvements you've recently made!)
Unfortunately, I found the current failure mode for this patch not to be
sufficiently helpful:
template <class T>
struct D : T {
void dosomething();
};
template <class T>
void D<T>::dosomething() {
f(); // problem
this->g(); // fix variant 1
T::h(); // fix variant 2
}
x.cc: In member function `void D<T>::dosomething()':
x.cc:8: error: there are no arguments to `f' that depend on a template
parameter, so a declaration of `f' must be available
x.cc:8: error: (if you use `-fpermissive', G++ will accept your code, but
allowing the use of an undeclared name is deprecated)
Without following gcc-patches and your changes to libstdc++, I certainly
would not have known that I need to add "this->" to qualify such
functions.
Alos, I'm not a language lawyer, but is "this->g()" indeed a declaration??
I'm a bit afraid I may start sounding like Joseph, but for changes like
this, which surely will break tons of C++ programs out there, we really
need to provide more information for our users, for example by providing
a clear explanation as part of the documentation for -fpermissive and as
part of the release notes.
Most importantly, this should include how to rewrite programs affected
by this.
Gerald