------- Comment #6 from mmitchel at gcc dot gnu dot org 2006-05-31 19:54 ------- GCC 3.3 isn't really a very good benchmark, since the parser there didn't handle much of the language. We'd have to figure out what it actually did for recovery (how many tokens did it skip, where did it pick things back up), and then decide if that was a workable strategy.
Fundamentally, though, you only have three options: 1. Skip until you see the end of the block (EDG behavior) 2. Pop to global scope. Problem: if the user accidentally had a definition in local scope, but intended the following stuff to be in the local scope, then you get confused. 3. Stay in local scope (current GCC behavior). Problem: if the user forgot the closing brace (and so intended stuff to be in the global scope), then you get confused. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26058