summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-11-07 19:56:07 +0000
committerDaniel Jasper <djasper@google.com>2013-11-07 19:56:07 +0000
commita98da3d236ac9cf8cf1e818069245fcdf307b783 (patch)
treed474aabb68707987a04abe2a476d6399c0c95d36 /clang/lib/Format
parent786d8a26f22e72b8fb8074df613b42c8e79a51ea (diff)
downloadbcm5719-llvm-a98da3d236ac9cf8cf1e818069245fcdf307b783.tar.gz
bcm5719-llvm-a98da3d236ac9cf8cf1e818069245fcdf307b783.zip
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
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 69e558571f9..5c70c8f914a 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -620,7 +620,7 @@ private:
Contexts.back().InCtorInitializer = true;
} else if (Current.is(tok::kw_new)) {
Contexts.back().CanBeExpression = false;
- } else if (Current.is(tok::semi)) {
+ } else if (Current.is(tok::semi) || Current.is(tok::exclaim)) {
// This should be the condition or increment in a for-loop.
Contexts.back().IsExpression = true;
}
OpenPOWER on IntegriCloud