On Fri, 26 Feb 2010 10:45:28 +0200, John McCall <[email protected]> wrote: > not crashing on bad code.
Infinite loops aren't much better. > On the other hand, I have just signed myself up to fix fiddly parser > errors for the next week. Again. Of course you did. > Modified: cfe/trunk/lib/Parse/ParseDecl.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=97221&r1=97220&r2=97221&view=diff > ============================================================================== > --- cfe/trunk/lib/Parse/ParseDecl.cpp (original) > +++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Feb 26 02:45:28 2010 > @@ -859,10 +859,13 @@ > return; > case tok::coloncolon: // ::foo::bar > - // Annotate C++ scope specifiers. If we get one, loop. > - if (TryAnnotateCXXScopeToken(true)) > - continue; > - goto DoneWithDeclSpec; > + // C++ scope specifier. Annotate and loop, or bail out on error. > + if (TryAnnotateCXXScopeToken(true)) { > + if (!DS.hasTypeSpecifier()) > + DS.SetTypeSpecError(); > + goto DoneWithDeclSpec; > + } > + continue; I think this should have been: - if (TryAnnotateCXXScopeToken(true)) { + if (!TryAnnotateCXXScopeToken(true)) { It would fix bug 5825. -- Andrius _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
