This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: PR 11493 and PR 11495


Below I'll try to sketch out few (and hopefully) easy changes that I,
qua guinea pig :-), consider useful.

Unfortunately, for the next couple of days I shouldn't spend even a
second on GCC, so any help you can provide addressing the suggestion
would be great!

On Wed, 16 Jul 2003, Wolfgang Bangerth wrote:
> We already have this, see node "Name lookup" in trouble.texi. When I wrote
> that section, I think we agreed that it should also go into the frequent-bug
> section of the online pages, but we never got around to actually do that.
>
> There might be an easy copy-and-paste way using texi2html, but I'm not aware
> of what is the simplest thing to copy that section, do you?

Hmm, duplication is bad, but...

Suggestion 1: Add a reference from <http://gcc.gnu.org/bugs.html#nonbugs>
to <http://gcc.gnu.org/onlinedocs/gcc/C---Misunderstandings.html>.

> Also, since we now have such an error message, it might be worth copying
> your example along with the message into the manual so that people can
> grep the manual for the error they see.

Suggestion 2: Add the following reduced variant of my example to
trouble.texi, together with the (updated) error message.

----- cut -----
template <class T>
struct D : T {
  void dosomething() {
    f();         // problem
    this->f();   // fix variant 1
    T::f();      // fix variant 2
  }
};
----- cut -----

On Wed, 16 Jul 2003, Jason Merrill wrote:
> Yes, so the error message should suggest that possibility as well.

Suggestion 3: Change the error message to

  there are no arguments to `f' that depend on a template parameter, so
  a declaration of `f' must be available; if `f' is a member of a base
  class, you can write `this->f' instead.

> Literature is not a replacement for good diagnostics.

Fully agreed. :-)

On Wed, 16 Jul 2003, Mark Mitchell wrote:
> I think Gerald is the best guinea pig :-) at the moment.  If he can tell
> us what he wishes the diagnostic had said, we can make it say that.

Given that the error message referred me to -fpermissive, I had checked
the corresponding documentation but only found the following:

  `-fpermissive'
     Downgrade some diagnostics about nonconformant code from errors to
     warnings.  Thus, using `-fpermissive' will allow some
     nonconforming code to compile.

Even a short and incomplete list of things -fpermissive makes acceptable
input would have been very helpful.

Suggestion 4: Add such a short list of changes you are aware of and
consider relevant to the documentation of -fpermissive; most importantly,
reference the (enhanced) documentation on name lookup from there.

> Do you think the bits that Wolfgang pointed at our sufficient?  Do you
> have ideas about how to make them more accessible to people?

I hope the above are useful! :-)

Gerald


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]