In:
struct A {
A()
noexcept(....) {}
};
'A()' is not a macro call.
This fixes llvm.org/PR19814.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209294
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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() {
"}\n"));
EXPECT_EQ("class A {\n"
" A() : t(0) {}\n"
+ " A(int i) noexcept() : {}\n"
" A(X x)\n" // FIXME: function-level try blocks are broken.
" try : t(0) {\n"
" } catch (...) {\n"
"};",
format("class A {\n"
" A()\n : t(0) {}\n"
+ " A(int i)\n noexcept() : {}\n"
" A(X x)\n"
" try : t(0) {} catch (...) {}\n"
"};"));