This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37302] New: function parameters are declared too late
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2008 18:19:57 -0000
- Subject: [Bug c++/37302] New: function parameters are declared too late
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
3.3.1: The point of declaration for a name is immediately after its complete
declarator (clause 8) and before its initializer (if any)
3.3.2: The potential scope of a function parameter name ... begins at its point
of declaration.
So this ought to be well-formed:
void f (int t, char (*buf_p)[sizeof(t)]) {}
but G++ doesn't declare 't' until after the closing paren, so name lookup
fails.
This wasn't a very interesting bug until the advent of late-specified return
types, which relies on naming parameters to be at all useful.
--
Summary: function parameters are declared too late
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37302