This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR30891: poor diagnostic with namespace in the function scope
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Cc: jason at redhat dot com, mark at codesourcery dot com, nathan at codesourcery dot com
- Date: Mon, 12 Mar 2007 01:04:23 +0000
- Subject: PR30891: poor diagnostic with namespace in the function scope
: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.