On Sun, Feb 26, 2012 at 9:24 PM, Richard Smith <[email protected]> wrote: > Author: rsmith > Date: Sun Feb 26 23:24:00 2012 > New Revision: 151515 > > URL: http://llvm.org/viewvc/llvm-project?rev=151515&view=rev > Log: > Fix decltype crash-on-invalid, if we don't find a matching ')' for an > ill-formed > decltype expression. > > Modified: > cfe/trunk/lib/Parse/ParseDeclCXX.cpp > cfe/trunk/test/Parser/bracket-crash.cpp > > Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=151515&r1=151514&r2=151515&view=diff > ============================================================================== > --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original) > +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Sun Feb 26 23:24:00 2012 > @@ -674,9 +674,9 @@ > 0, /*IsDecltype=*/true); > Result = ParseExpression(); > if (Result.isInvalid()) { > - SkipUntil(tok::r_paren, true, true); > + SkipUntil(tok::r_paren); > DS.SetTypeSpecError(); > - return Tok.is(tok::eof) ? Tok.getLocation() : ConsumeParen(); > + return StartLoc;
If I recall correctly this return value is used to get the range of the decltype specifier - by returning StartLoc the range of the decltype expression will be a bit off. I realize it's an error case anyway, so I'm not sure how important that is, just a thought. - David > } > > // Match the ')' > > Modified: cfe/trunk/test/Parser/bracket-crash.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/bracket-crash.cpp?rev=151515&r1=151514&r2=151515&view=diff > ============================================================================== > --- cfe/trunk/test/Parser/bracket-crash.cpp (original) > +++ cfe/trunk/test/Parser/bracket-crash.cpp Sun Feb 26 23:24:00 2012 > @@ -1,6 +1,6 @@ > -// RUN: not %clang_cc1 -fsyntax-only %s > +// RUN: not %clang_cc1 -fsyntax-only -std=c++11 %s > // PR7481 > +decltype(; > struct{ > a > } > - > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
