This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 34758
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 20 Jan 2008 21:44:49 +0100
- Subject: Re: [C++ Patch] PR 34758
- References: <478FD2ED.4060906@suse.de> <47939FA4.7050106@codesourcery.com>
Hi,
> ! if (parmnum != 0 || TREE_CHAIN (parm) != void_list_node)
>
> I don't understand this conditional. Why does it matter whether we're
> looking at the first argument or not?
>
Oh, well, that's only a "cosmetic" issue: for testcases like the one in
the PR, when there is only *one* parameter, the errror message is more
neat.... Actually, I was under the impression that this specific nit was
a large part of the PR...
> Also, I'm not sure I agree that "circular dependency" is a very clear
> way to explain this problem. If I recall correctly, there doesn't
> actually have to be a circular dependency to make the code invalid.
>
> In particular, if the default argument tried to invoke a method with
> default arguments declared later in the class, I think we would have
> trouble too:
>
> struct S {
> S(const S& = f());
> static const S& f(int i = 3);
> };
>
> So, I'm not actually sure what's wrong with the current message. I
> think it explains the problem reasonably well.
>
I see... we can also close the PR as invalid ;) But, I'm not sure about
the first issue above...
Paolo.