llvm-project/clang/lib/Format
Nico Weber 1361a4c2d8 clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro.
This is like r305666 (which added support for `if constexpr`) except
that it allows a macro name after the if.

This is slightly tricky for two reasons:

1. r305666 didn't add test coverage for all cases where it added a
   kw_constexpr, so I had to figure out what all the added cases were
   for. I now added tests for all `if constexpr` bits that didn't have
   tests. (This took a while, see e.g. https://reviews.llvm.org/D65223)

2. Parsing `if <ident> (` as an if means that `#if defined(` and
   `#if __has_include(` parse as ifs too. Add some special-case code
   to prevent this from happening where it's incorrect.

Fixes PR39248.

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

llvm-svn: 367167
2019-07-27 02:41:40 +00:00
..
AffectedRangeManager.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AffectedRangeManager.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BreakableToken.cpp [clang-format] Fix bug in block comment reflow that joins * and / 2019-05-03 23:15:40 +00:00
BreakableToken.h [clang-format] Fix bug in block comment reflow that joins * and / 2019-05-03 23:15:40 +00:00
CMakeLists.txt Reland "Move #include manipulation code to new lib/Tooling/Inclusions." 2018-06-04 09:04:12 +00:00
ContinuationIndenter.cpp clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro. 2019-07-27 02:41:40 +00:00
ContinuationIndenter.h [clang-format] Fix indent of trailing raw string param after newline 2019-04-18 17:14:05 +00:00
Encoding.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Format.cpp [Format] getFormattingLangOpts: make LS_Auto uses LS_Cpp11 lexing rule 2019-07-24 09:50:56 +00:00
FormatInternal.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FormatToken.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FormatToken.h clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro. 2019-07-27 02:41:40 +00:00
FormatTokenLexer.cpp clang-format: better handle namespace macros 2019-06-06 20:06:23 +00:00
FormatTokenLexer.h [clang-format] Add basic support for formatting C# files 2019-03-21 13:09:22 +00:00
NamespaceEndCommentsFixer.cpp clang-format: Fix namespace end comments for namespaces with attributes and macros. 2019-07-23 17:49:45 +00:00
NamespaceEndCommentsFixer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SortJavaScriptImports.cpp Use llvm::stable_sort 2019-04-24 14:43:05 +00:00
SortJavaScriptImports.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TokenAnalyzer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TokenAnalyzer.h [clang-format] Remove unused Environment constructor. 2019-04-18 00:36:51 +00:00
TokenAnnotator.cpp clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro. 2019-07-27 02:41:40 +00:00
TokenAnnotator.h clang-format: better handle namespace macros 2019-06-06 20:06:23 +00:00
UnwrappedLineFormatter.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
UnwrappedLineFormatter.h [clang-format] [NFC] clang-format the Format library 2019-03-01 09:09:54 +00:00
UnwrappedLineParser.cpp clang-format: Support `if CONSTEXPR` if CONSTEXPR is a macro. 2019-07-27 02:41:40 +00:00
UnwrappedLineParser.h [clang-format] [NFC] clang-format the Format library 2019-03-01 09:09:54 +00:00
UsingDeclarationsSorter.cpp Use llvm::stable_sort 2019-04-24 14:43:05 +00:00
UsingDeclarationsSorter.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WhitespaceManager.cpp clang-format: Add new style option AlignConsecutiveMacros 2019-07-02 15:53:14 +00:00
WhitespaceManager.h clang-format: Add new style option AlignConsecutiveMacros 2019-07-02 15:53:14 +00:00