From 2ca766f32a775dd2d20c88d338728bb847651bde Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 10 Dec 2012 16:34:48 +0000 Subject: Clang-format: error recovery for access specifiers Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D198 llvm-svn: 169738 --- clang/lib/Format/UnwrappedLineParser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format/UnwrappedLineParser.cpp') diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index a225f3b3e78..8545f336b86 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -311,7 +311,9 @@ void UnwrappedLineParser::parseSwitch() { void UnwrappedLineParser::parseAccessSpecifier() { nextToken(); - nextToken(); + // Otherwise, we don't know what it is, and we'd better keep the next token. + if (FormatTok.Tok.is(tok::colon)) + nextToken(); addUnwrappedLine(); } -- cgit v1.2.3