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]

Re: [Ping] [C++ Patch] PR 78637 ("ICE on invalid C++ code (internal compiler error: in pop_namespace, at cp/name-lookup.c:3826)")


On 12/09/2016 11:33 AM, Paolo Carlini wrote:

this regression is caused by my fix for c++/60385, where I changed
push_namespace to early return (a bool) when pushdecl fails. In the
present testcase, a different push_namespace call in
cp_parser_namespace_definition, for nested namespace definitions,
fails, thus returns early, and that is inconsistent with the final
loop (pop_namespace ICEs):

  /* Finish the nested namespace definitions.  */
  while (nested_definition_count--)
    pop_namespace ();

To fix this problem, I think we can simply increment
nested_definition_count only when push_namespace succeeds. Tested
x86_64-linux.

Ok.  (Looks sufficiently obvious to me.)

nathan

--
Nathan Sidwell


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