summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-21 13:08:17 +0000
committerDaniel Jasper <djasper@google.com>2014-05-21 13:08:17 +0000
commit5ebb2f362501bfe197418f321bb86a093a64f375 (patch)
tree1ad11141b31da06a40f0df4b81907c996de17cd7 /clang/lib/Format
parent38eed1b86d5705fe43f054765f567894dcb773c7 (diff)
downloadbcm5719-llvm-5ebb2f362501bfe197418f321bb86a093a64f375.tar.gz
bcm5719-llvm-5ebb2f362501bfe197418f321bb86a093a64f375.zip
clang-format: Fix incorrect macro call detection.
In: struct A { A() noexcept(....) {} }; 'A()' is not a macro call. This fixes llvm.org/PR19814. llvm-svn: 209294
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 5af743bba5a..05854425503 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -605,7 +605,9 @@ bool tokenCanStartNewLine(clang::Token Tok) {
// Colon is used in labels, base class lists, initializer lists,
// range-based for loops, ternary operator, but should never be the
// first token in an unwrapped line.
- Tok.isNot(tok::colon);
+ Tok.isNot(tok::colon) &&
+ // 'noexcept' is a trailing annotation.
+ Tok.isNot(tok::kw_noexcept);
}
void UnwrappedLineParser::parseStructuralElement() {
OpenPOWER on IntegriCloud