This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9162: new parser: problem with default argument in a friend function
- From: jbuck at synopsys dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 3 Jan 2003 21:50:45 -0000
- Subject: c++/9162: new parser: problem with default argument in a friend function
- Reply-to: jbuck at synopsys dot com
>Number: 9162
>Category: c++
>Synopsis: new parser: problem with default argument in a friend function
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Jan 03 13:56:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Joe Buck
>Release: gcc version 3.4 20030102 (experimental)
>Organization:
>Environment:
GNU/Linux (Red Hat 7.2, i686)
(but probably all)
>Description:
Default arguments that appear in a friend declaration aren't
handled correctly by the new parser. Also, the error form
depends on whether or not the context is global or in a
namespace.
>How-To-Repeat:
Compile the attached code with "gcc -c bug.cpp". The output
is
bug.cpp: In function `void func(const C1&, const C1&)':
bug.cpp:10: error: the default argument for parameter 3 of `void multiply(C1&,
const C1&, const C1&, int)' has not yet been parsed
bug.cpp: In function `void N::func(const N::C2&, const N::C2&)':
bug.cpp:19: error: too few arguments to function `void N::multiply(N::C2&,
const N::C2&, const N::C2&, int = <unparsed>)'
bug.cpp:24: error: at this point in file
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.cpp"
Ly8gY2FzZSAxOiBub3QgaW4gbmFtZXNwYWNlCmNsYXNzIEMxIHsKcHVibGljOgogICAgQzEoKTsK
ICAgIGZyaWVuZCB2b2lkIG11bHRpcGx5KCBDMSYsIGNvbnN0IEMxJiwgY29uc3QgQzEmLCBpbnQg
PSAxMDAgKTsKfTsKCnZvaWQgZnVuYyhjb25zdCBDMSYgZm9vLCBjb25zdCBDMSYgYmFyKSB7CiAg
ICBDMSB0ZW1wOwogICAgbXVsdGlwbHkodGVtcCwgZm9vLCBiYXIpOwp9CgovLyBjYXNlIDI6IGlu
IGEgbmFtZXNwYWNlCm5hbWVzcGFjZSBOIHsKCmNsYXNzIEMyIHsKcHVibGljOgogICAgQzIoKTsK
ICAgIGZyaWVuZCB2b2lkIG11bHRpcGx5KCBDMiYsIGNvbnN0IEMyJiwgY29uc3QgQzImLCBpbnQg
PSAxMDAgKTsKfTsKCnZvaWQgZnVuYyhjb25zdCBDMiYgZm9vLCBjb25zdCBDMiYgYmFyKSB7CiAg
ICBDMiB0ZW1wOwogICAgTjo6bXVsdGlwbHkodGVtcCwgZm9vLCBiYXIpOwp9Cn0K