summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-06-18 15:45:17 +0000
committerDaniel Jasper <djasper@google.com>2015-06-18 15:45:17 +0000
commit47721ac75d8b14dc09cbc6ee1906c1319610a4d1 (patch)
tree55b052d69a0414d669e5803f2a86468726f733fb /clang/lib/Format
parentf90346f8f6ebd4ce4589ba070e4baaeede80988a (diff)
downloadbcm5719-llvm-47721ac75d8b14dc09cbc6ee1906c1319610a4d1.tar.gz
bcm5719-llvm-47721ac75d8b14dc09cbc6ee1906c1319610a4d1.zip
clang-format: Better support functions with elaborated enum return types.
Before, this wasn't formatted properly: enum ::C f() { return a; } llvm-svn: 240021
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index aa46e7464cd..6846158fb3a 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -1491,6 +1491,8 @@ void UnwrappedLineParser::parseEnum() {
while (FormatTok->Tok.getIdentifierInfo() ||
FormatTok->isOneOf(tok::colon, tok::coloncolon, tok::less,
tok::greater, tok::comma, tok::question)) {
+ if (FormatTok->is(tok::coloncolon))
+ nextToken();
nextToken();
// We can have macros or attributes in between 'enum' and the enum name.
if (FormatTok->is(tok::l_paren))
OpenPOWER on IntegriCloud