diff options
author | Manuel Klimek <klimek@google.com> | 2013-02-06 15:57:54 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-02-06 15:57:54 +0000 |
commit | d265090cd67ebb3f2dd280a30722b07f080eefce (patch) | |
tree | b88bc6a6af2d595d80ed28187cdb1760ce5a38f1 /clang/lib/Format | |
parent | 09aba10499fc621907ff4153a030e79c3456670c (diff) | |
download | bcm5719-llvm-d265090cd67ebb3f2dd280a30722b07f080eefce.tar.gz bcm5719-llvm-d265090cd67ebb3f2dd280a30722b07f080eefce.zip |
Parse record declarations with token pasted identifiers.
This is pretty common in macros:
#define A(X, Y) class X##Y {};
llvm-svn: 174512
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 19bca8d860d..f79cc712f43 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/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 |