clang-format: Correctly detect multiplication in ctor initializer.
Before:
Constructor() : a(a), area(width *height) {}
After:
Constructor() : a(a), area(width * height) {}
llvm-svn: 222010
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 5234de2..104eb1d 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -763,7 +763,7 @@
Previous && Previous->isOneOf(tok::star, tok::amp);
Previous = Previous->Previous)
Previous->Type = TT_PointerOrReference;
- Contexts.back().IsExpression = false;
+ Contexts.back().IsExpression = Contexts.back().InCtorInitializer;
} else if (Current.Previous &&
Current.Previous->Type == TT_CtorInitializerColon) {
Contexts.back().IsExpression = true;