diff options
author | Daniel Jasper <djasper@google.com> | 2013-09-17 09:52:48 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-09-17 09:52:48 +0000 |
commit | fb81b09d8702f5c8d08d6a019331638c13bf71bb (patch) | |
tree | e32fe6937f9fbbd36a39440982a1bcf4f05c3732 /clang/lib/Format/TokenAnnotator.h | |
parent | c947eb08b5ff1a38c1a962cc38399376f4bf63b6 (diff) | |
download | bcm5719-llvm-fb81b09d8702f5c8d08d6a019331638c13bf71bb.tar.gz bcm5719-llvm-fb81b09d8702f5c8d08d6a019331638c13bf71bb.zip |
clang-format: Don't accidentally move tokens into preprocessor directive.
This fixes llvm.org/PR17265.
Before:
Foo::Foo()
#ifdef BAR
: baz(0)
#endif {
}
After:
Foo::Foo()
#ifdef BAR
: baz(0)
#endif
{
}
llvm-svn: 190861
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.h')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.h b/clang/lib/Format/TokenAnnotator.h index 06f335215d1..91f1b4678a1 100644 --- a/clang/lib/Format/TokenAnnotator.h +++ b/clang/lib/Format/TokenAnnotator.h @@ -110,6 +110,8 @@ private: bool spaceRequiredBefore(const AnnotatedLine &Line, const FormatToken &Tok); + bool mustBreakBefore(const AnnotatedLine &Line, const FormatToken &Right); + bool canBreakBefore(const AnnotatedLine &Line, const FormatToken &Right); void printDebugInfo(const AnnotatedLine &Line); |