Teach clang-format to understand static_asserts better.
Before:
template <bool B, bool C>
class A {
static_assert(B &&C, "Something is wrong");
};
After:
template <bool B, bool C>
class A {
static_assert(B && C, "Something is wrong");
};
(Note the spacing around '&&'). Also change the identifier table to always
understand all C++11 keywords (which seems like the right thing to do).
llvm-svn: 187589
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 290f059..f59fb37 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1330,7 +1330,7 @@
FormatTokenLexer(Lexer &Lex, SourceManager &SourceMgr,
encoding::Encoding Encoding)
: FormatTok(NULL), GreaterStashed(false), TrailingWhitespace(0), Lex(Lex),
- SourceMgr(SourceMgr), IdentTable(Lex.getLangOpts()),
+ SourceMgr(SourceMgr), IdentTable(getFormattingLangOpts()),
Encoding(Encoding) {
Lex.SetKeepWhitespaceMode(true);
}