This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]