aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-02-06 15:57:54 +0000
committerManuel Klimek <klimek@google.com>2013-02-06 15:57:54 +0000
commitb8b1ce12362860e55590c55fd43db875c9193357 (patch)
treeeaff41bfc04490d5d61647077210e4cbc1fe9a77 /lib/Format/UnwrappedLineParser.cpp
parent36ba0ff4b632cff7424693b9818bcc8d9ea7798a (diff)
Parse record declarations with token pasted identifiers.
This is pretty common in macros: #define A(X, Y) class X##Y {}; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--lib/Format/UnwrappedLineParser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index 19bca8d860..f79cc712f4 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/lib/Format/UnwrappedLineParser.cpp
@@ -650,9 +650,11 @@ void UnwrappedLineParser::parseRecord() {
if (FormatTok.Tok.is(tok::l_paren)) {
parseParens();
}
- // The actual identifier can be a nested name specifier.
+ // The actual identifier can be a nested name specifier, and in macros
+ // it is often token-pasted.
while (FormatTok.Tok.is(tok::identifier) ||
- FormatTok.Tok.is(tok::coloncolon))
+ FormatTok.Tok.is(tok::coloncolon) ||
+ FormatTok.Tok.is(tok::hashhash))
nextToken();
// Note that parsing away template declarations here leads to incorrectly