Bug 37302 - function parameters are declared too late
Summary: function parameters are declared too late
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-31 18:19 UTC by Jason Merrill
Modified: 2008-11-22 00:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-01 03:38:45


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Merrill 2008-08-31 18:19:57 UTC
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.
Comment 1 Jason Merrill 2008-09-17 16:13:30 UTC
Fixed.