clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier
authorSam McCall <sam.mccall@gmail.com>
Wed, 5 Sep 2018 07:44:02 +0000 (07:44 +0000)
committerSam McCall <sam.mccall@gmail.com>
Wed, 5 Sep 2018 07:44:02 +0000 (07:44 +0000)
commit6f3778c3725e0f7de9e153e2f3b2b361cd7016f8
treeda10bcdecf432b1b21d2078dfd77d0accbd11322
parentf592d281a72b19131e447a3695f5a4a114eaebff
clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier

This fixes formatting namespaces with preceding 'inline' and 'export' (Modules TS) specifiers.

This change fixes namespaces not being identified as such with preceding 'inline' or 'export' specifiers.

Motivation: I was experimenting with the Modules TS (-fmodules-ts) and found it would be useful if clang-format would correctly format 'export namespace'. While making the changes, I noticed that similar issues still exist with 'inline namespace', and addressed them as well.

Patch by Marco Elver!

Reviewers: klimek, djasper, owenpan, sammccall

Reviewed By: owenpan, sammccall

Subscribers: owenpan, cfe-commits

Differential Revision: https://reviews.llvm.org/D51036

llvm-svn: 341450
clang/lib/Format/Format.cpp
clang/lib/Format/FormatToken.h
clang/lib/Format/NamespaceEndCommentsFixer.cpp
clang/lib/Format/TokenAnnotator.h
clang/lib/Format/UnwrappedLineFormatter.cpp
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp