diff options
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 07109daf6f9..752357c1aff 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -992,13 +992,6 @@ void UnwrappedLineParser::parseStructuralElement() { case tok::kw_namespace: parseNamespace(); return; - case tok::kw_inline: - nextToken(); - if (FormatTok->Tok.is(tok::kw_namespace)) { - parseNamespace(); - return; - } - break; case tok::kw_public: case tok::kw_protected: case tok::kw_private: @@ -1066,6 +1059,16 @@ void UnwrappedLineParser::parseStructuralElement() { parseJavaScriptEs6ImportExport(); return; } + if (!Style.isCpp()) + break; + // Handle C++ "(inline|export) namespace". + LLVM_FALLTHROUGH; + case tok::kw_inline: + nextToken(); + if (FormatTok->Tok.is(tok::kw_namespace)) { + parseNamespace(); + return; + } break; case tok::identifier: if (FormatTok->is(TT_ForEachMacro)) { |