[cfe-commits] r97221 - in /cfe/trunk: include/clang/Parse/ lib/Parse/ test/CXX/temp/temp.fct.spec/temp.arg.explicit/ test/Parser/ test/SemaCXX/ test/SemaTemplate/
Andrius Morkūnas
hinokind at gmail.com
Mon Mar 1 06:57:37 PST 2010
On Fri, 26 Feb 2010 10:45:28 +0200, John McCall <rjmccall at apple.com> 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
More information about the cfe-commits
mailing list