aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-21 10:17:14 +0000
committerManuel Klimek <klimek@google.com>2013-01-21 10:17:14 +0000
commit7f5b025e9b9a981a257d83063064ac6e58239d76 (patch)
tree6c9178c376e31b8bb481191debcd67c5d2032556 /lib/Format/UnwrappedLineParser.cpp
parentc44ee89cb448e34aada006b707eb45a1280f31e3 (diff)
Allow for nested name specifiers in record declarations.
Now correctly formats: class A::B {} n; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--lib/Format/UnwrappedLineParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index 3fd1ff9024..dffc309a09 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/lib/Format/UnwrappedLineParser.cpp
@@ -615,7 +615,9 @@ void UnwrappedLineParser::parseRecord() {
if (FormatTok.Tok.is(tok::l_paren)) {
parseParens();
}
- if (FormatTok.Tok.is(tok::identifier))
+ // The actual identifier can be a nested name specifier.
+ while (FormatTok.Tok.is(tok::identifier) ||
+ FormatTok.Tok.is(tok::coloncolon))
nextToken();
if (FormatTok.Tok.is(tok::colon)) {