switch (FormatTok->Previous->Tok.getKind()) {
case tok::coloncolon: // Nested identifier.
case tok::ampamp: // Start of a function or variable for the
- case tok::pipepipe: // constraint expression.
+ case tok::pipepipe: // constraint expression. (binary)
+ case tok::exclaim: // The same as above, but unary.
case tok::kw_requires: // Initial identifier of a requires clause.
case tok::equal: // Initial identifier of a concept declaration.
break;
"sizeof(T) <= 8;");
verifyFormat("template <typename T>\n"
+ "concept DelayedCheck = Unit<T> && !DerivedUnit<T>;");
+
+ verifyFormat("template <typename T>\n"
+ "concept DelayedCheck = Unit<T> && !(DerivedUnit<T>);");
+
+ verifyFormat("template <typename T>\n"
+ "concept DelayedCheck = Unit<T> && !!DerivedUnit<T>;");
+
+ verifyFormat("template <typename T>\n"
"concept DelayedCheck = !!false || requires(T t) { t.bar(); } "
"&& sizeof(T) <= 8;");
EXPECT_TOKEN(Tokens[16], tok::ampamp, TT_BinaryOperator);
Tokens = annotate("template <typename T>\n"
+ "concept C = Foo && !Bar;");
+
+ ASSERT_EQ(Tokens.size(), 14u) << Tokens;
+ EXPECT_TOKEN(Tokens[9], tok::ampamp, TT_BinaryOperator);
+ EXPECT_TOKEN(Tokens[10], tok::exclaim, TT_UnaryOperator);
+
+ Tokens = annotate("template <typename T>\n"
"concept C = requires(T t) {\n"
" { t.foo() };\n"
"} && Bar<T> && Baz<T>;");