Does GCC 3.4 fix this bug?
Oliver Kullmann
O.Kullmann@Swansea.ac.uk
Thu Sep 11 17:06:00 GMT 2003
On Thu, Sep 11, 2003 at 11:46:56AM -0500, Eljay Love-Jensen wrote:
> Date: Thu, 11 Sep 2003 11:46:56 -0500
> From: Eljay Love-Jensen <eljay@adobe.com>
> In-reply-to: <20030911163705.GA19868@swan.ac.uk>
> X-Sender: eljay@iplan-mn.corp.adobe.com
> To: Oliver Kullmann <O.Kullmann@swansea.ac.uk>, gcc-help@gcc.gnu.org
> X-Mailer: QUALCOMM Windows Eudora Version 5.2.1
> X-SA-Exim-Mail-From: eljay@adobe.com
> Subject: Re: Does GCC 3.4 fix this bug?
> X-Spam-Checker-Version: SpamAssassin 2.60-rc1 (1.197-2003-08-21-exp) on mhs
> X-Spam-Level:
> X-Spam-Status: No, hits=0.0 required=5.5 tests=none autolearn=no version=2.60-rc1
> X-SA-Exim-Version: 3.1 (built Fri Aug 22 12:30:01 GMT 2003)
> X-UIDL: <k!"!(\G"!a@j"!0L("!
>
> Hi Oliver,
>
> Even when doing...
> auto Bar quux(Foo());
> ...it still takes it as a declaration instead of a definition. That doesn't seem kosher at all.
>
> --Eljay
>
>
I'm not sure about the exact syntax regarding storage specifiers like auto, however I'm quite
sure that for the first example you gave as a bug g++ is absolutely correct (and other compilers,
if accepting the construction, are not): Have a look into Section 8.2 of the standard.
(There is also a section in one of Scott Myers books about it, called something like
"C++ most vexing parse").
I would guess adding something like auto shouldn't change much.
The solution using double brackets is not mentioned in the standard, but I believe it's
perfectly correct (I think it's in Myers book), and can be used in other circumstances too:
Always when you see suddenly this function-pointer-brackets showing up in error messages,
then it's a variation of the same old problem! (I experience these problems roughly once
a month.)
Oliver
More information about the Gcc-help
mailing list