summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-12-30 21:27:25 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-12-30 21:27:25 +0000
commit58d64e2bb1b47ee6fd20c0493a2a9712f11cf1ae (patch)
tree030cf9529ed1007c476cbb8f5ae4b33c62b143cc /clang/lib/Format/UnwrappedLineParser.cpp
parent2a5f569d882b71619cf4a9b3fe48fac6ade8b806 (diff)
downloadbcm5719-llvm-58d64e2bb1b47ee6fd20c0493a2a9712f11cf1ae.tar.gz
bcm5719-llvm-58d64e2bb1b47ee6fd20c0493a2a9712f11cf1ae.zip
Formatter: parse and format inline namespaces like regular namespaces
This changes formatting from: inline namespace X { class A { }; } to: inline namespace X { class A { }; } llvm-svn: 171266
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 6c035b001c7..78a1abdcf8d 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -100,10 +100,19 @@ void UnwrappedLineParser::parseComments() {
void UnwrappedLineParser::parseStatement() {
parseComments();
+ int TokenNumber = 0;
switch (FormatTok.Tok.getKind()) {
case tok::kw_namespace:
parseNamespace();
return;
+ case tok::kw_inline:
+ nextToken();
+ TokenNumber++;
+ if (FormatTok.Tok.is(tok::kw_namespace)) {
+ parseNamespace();
+ return;
+ }
+ break;
case tok::kw_public:
case tok::kw_protected:
case tok::kw_private:
@@ -132,7 +141,6 @@ void UnwrappedLineParser::parseStatement() {
default:
break;
}
- int TokenNumber = 0;
do {
++TokenNumber;
switch (FormatTok.Tok.getKind()) {
OpenPOWER on IntegriCloud