re PR c++/30891 (poor diagnostic with namespace in the function scope)
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Thu, 15 Mar 2007 22:45:17 +0000 (22:45 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Thu, 15 Mar 2007 22:45:17 +0000 (22:45 +0000)
commit2ce88bea6d9c7d451c9f2f5eda2f91de7884da65
tree9ad6ddd1ac48e6d49a9f4b8b3b4912f4dbe71d00
parent9b439fe168ff6dacb3aa606f43a2103b68b89ded
re PR c++/30891 (poor diagnostic with namespace in the function scope)

2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR c++/30891
cp/
* 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.

From-SVN: r122962
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/namespace-definition.C [new file with mode: 0644]