From 8035b0a6ced4dd3f1a0f34e0a027005b53f7753b Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 6 Feb 2013 10:57:42 +0000 Subject: Fix an issue with the formatting of stars in default values. Before: void f(int *a = d *e, int b = 0); After: void f(int *a = d * e, int b = 0); llvm-svn: 174500 --- clang/lib/Format/TokenAnnotator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index ca8d595df76..1a55985905c 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -519,7 +519,7 @@ private: if (getPrecedence(Current) == prec::Assignment) { Contexts.back().IsExpression = true; AnnotatedToken *Previous = Current.Parent; - while (Previous != NULL) { + while (Previous != NULL && Previous->isNot(tok::comma)) { if (Previous->Type == TT_BinaryOperator && (Previous->is(tok::star) || Previous->is(tok::amp))) { Previous->Type = TT_PointerOrReference; -- cgit v1.2.3