re PR c++/81247 (ICE on invalid C++ code with malformed namespace declaration: in...
authorNathan Sidwell <nathan@acm.org>
Thu, 29 Jun 2017 18:20:13 +0000 (18:20 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 29 Jun 2017 18:20:13 +0000 (18:20 +0000)
commitbe3b7dcf5c0f48ce72fe7a6f30db350e5c6872f3
tree826f90271e7bf7bbe7d17c9e5d7c85d88c8576ae
parent6044f5e327761e0030f3b792fe5e5f38ff9032e2
re PR c++/81247 (ICE on invalid C++ code with malformed namespace declaration: in do_push_nested_namespace, at cp/name-lookup.c:6002)

PR c++/81247
* parser.c (cp_parser_namespace_definition): Immediately close the
namespace if there's no open-brace.
* name-lookup.c (do_pushdecl): Reset OLD when pushing into new
namespace.

From-SVN: r249804
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/pr81247-a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/pr81247-b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/pr81247-c.C [new file with mode: 0644]