[clang-format] Detect constructor initializers preceded by `noexcept`.
Patch by Erik Kessler, thank you. llvm-svn: 262402
This commit is contained in:
parent
46e57fd073
commit
56ef6aca2b
|
@ -505,7 +505,7 @@ private:
|
|||
Tok->Type = TT_BitFieldColon;
|
||||
} else if (Contexts.size() == 1 &&
|
||||
!Line.First->isOneOf(tok::kw_enum, tok::kw_case)) {
|
||||
if (Tok->Previous->is(tok::r_paren))
|
||||
if (Tok->Previous->isOneOf(tok::r_paren, tok::kw_noexcept))
|
||||
Tok->Type = TT_CtorInitializerColon;
|
||||
else
|
||||
Tok->Type = TT_InheritanceColon;
|
||||
|
|
|
@ -10389,6 +10389,9 @@ TEST_F(FormatTest, BreakConstructorInitializersBeforeComma) {
|
|||
verifyFormat("SomeClass::Constructor()\n"
|
||||
" : a(a) {}",
|
||||
Style);
|
||||
verifyFormat("SomeClass::Constructor() noexcept\n"
|
||||
" : a(a) {}",
|
||||
Style);
|
||||
verifyFormat("SomeClass::Constructor()\n"
|
||||
" : a(a)\n"
|
||||
" , b(b)\n"
|
||||
|
|
Loading…
Reference in New Issue