clang-format: Improve binary operator detection in macros.
Before:
#define M(NAME) assert(!Context.Verifying &&#NAME);
After:
#define M(NAME) assert(!Context.Verifying && #NAME);
This fixes llvm.org/PR16156.
llvm-svn: 194216
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 1822a24..3684e07 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4081,6 +4081,7 @@
verifyFormat("for (int i = 0; i < a * a; ++i) {\n}");
verifyGoogleFormat("for (int i = 0; i * 2 < z; i *= 2) {\n}");
+ verifyFormat("#define A (!a * b)");
verifyFormat("#define MACRO \\\n"
" int *i = a * b; \\\n"
" void f(a *b);",