summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-08-28 08:24:04 +0000
committerDaniel Jasper <djasper@google.com>2013-08-28 08:24:04 +0000
commited8f1c6dce6f82fda1477d668d798ac01d491367 (patch)
treecbe9d51ba3ffd932dbf221b806b647d2727ffe53 /clang/lib/Format/TokenAnnotator.cpp
parent0803953cea1d6fe888f30b1146f61e2b91d9d084 (diff)
downloadbcm5719-llvm-ed8f1c6dce6f82fda1477d668d798ac01d491367.tar.gz
bcm5719-llvm-ed8f1c6dce6f82fda1477d668d798ac01d491367.zip
clang-format: Don't insert space in __has_include
Before: #if __has_include( <strstream>) #include <strstream> #endif After: #if __has_include(<strstream>) #include <strstream> #endif This fixes llvm.org/PR16516. llvm-svn: 189455
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index bec589d572f..b634bbdbf62 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1292,7 +1292,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
return true;
if (Tok.Previous->Type == TT_TemplateCloser && Tok.is(tok::l_paren))
return false;
- if (Tok.is(tok::less) && Line.First->is(tok::hash))
+ if (Tok.is(tok::less) && Tok.Previous->isNot(tok::l_paren) &&
+ Line.First->is(tok::hash))
return true;
if (Tok.Type == TT_TrailingUnaryOperator)
return false;
OpenPOWER on IntegriCloud