re PR c++/78637 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: in pop_namespace, at cp/name-lookup.c:3826))

/cp
2016-12-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78637
	* parser.c (cp_parser_namespace_definition): Increment
	nested_definition_count only if push_namespace succeeds.

/testsuite
2016-12-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78637
	* g++.dg/parse/namespace14.C: New.

From-SVN: r243529
This commit is contained in:
Paolo Carlini 2016-12-11 18:15:31 +00:00 committed by Paolo Carlini
parent a2cb05ed72
commit a1f7d967aa
4 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-12-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/78637
* parser.c (cp_parser_namespace_definition): Increment
nested_definition_count only if push_namespace succeeds.
2016-12-08 Nathan Sidwell <nathan@acm.org>
PR c++/78551

View File

@ -18184,8 +18184,8 @@ cp_parser_namespace_definition (cp_parser* parser)
cp_parser_error (parser, "nested identifier required");
break;
}
++nested_definition_count;
push_namespace (identifier);
if (push_namespace (identifier))
++nested_definition_count;
}
}

View File

@ -1,3 +1,8 @@
2016-12-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/78637
* g++.dg/parse/namespace14.C: New.
2016-12-10 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/78720

View File

@ -0,0 +1,6 @@
// PR c++/78637
namespace X {
class Y;
}
namespace X::Y z; // { dg-error "namespace|expected|type" }