Index: unittests/Format/FormatTest.cpp
===================================================================
--- unittests/Format/FormatTest.cpp	(revision 171260)
+++ unittests/Format/FormatTest.cpp	(working copy)
@@ -349,6 +349,13 @@
                "  f();\n"
                "}\n"
                "}");
+  verifyFormat("inline namespace X {\n"
+               "class A {\n"
+               "};\n"
+               "void f() {\n"
+               "  f();\n"
+               "}\n"
+               "}");
   verifyFormat("using namespace some_namespace;\n"
                "class A {\n"
                "};\n"
Index: lib/Format/UnwrappedLineParser.cpp
===================================================================
--- lib/Format/UnwrappedLineParser.cpp	(revision 171260)
+++ lib/Format/UnwrappedLineParser.cpp	(working copy)
@@ -100,10 +100,19 @@
 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 @@
   default:
     break;
   }
-  int TokenNumber = 0;
   do {
     ++TokenNumber;
     switch (FormatTok.Tok.getKind()) {
