PR30891: poor diagnostic with namespace in the function scope

Manuel López-Ibáñez lopezibanez@gmail.com
Mon Mar 12 04:14:00 GMT 2007


Version 2.0: Now with patch included ;-)

On 12/03/07, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> :ADDPATCH C++:
>
> When a namespace definition is found in function scope, the current
> error is far from helpful. This patch gives a clear message for this
> particular case.
>
> Bootstrapped + regression tested.
>
> OK for mainline?
>
> 2007-03-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
>
>   PR c++/30891
>   * parser.c (cp_parser_statement): If 'namespace' is found, this only
> can be a namespace alias definition, so parse it now.
>   (cp_parser_namespace_alias_definition): if we find an open brace
> instead of '=', then this is actually a misplaced namespace
> definition.
>
> testsuite/
>   * g++.dg/parse/namespace-definition.C: New.
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: namespace-parser.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070312/63e40baf/attachment.ksh>


More information about the Gcc-patches mailing list