@@ -263,8 +263,7 @@ class AnnotatingParser {
263
263
Previous->setType (TT_SelectorName);
264
264
}
265
265
}
266
- }
267
- if (Style.isTableGen ()) {
266
+ } else if (Style.isTableGen ()) {
268
267
if (CurrentToken->isOneOf (tok::comma, tok::equal)) {
269
268
// They appear as separators. Unless they are not in class definition.
270
269
next ();
@@ -3016,12 +3015,13 @@ class AnnotatingParser {
3016
3015
return TT_BinaryOperator;
3017
3016
3018
3017
const FormatToken *NextToken = Tok.getNextNonComment ();
3018
+ if (!NextToken)
3019
+ return TT_PointerOrReference;
3019
3020
3020
- if (InTemplateArgument && NextToken && NextToken ->is (tok::kw_noexcept))
3021
+ if (InTemplateArgument && NextToken->is (tok::kw_noexcept))
3021
3022
return TT_BinaryOperator;
3022
3023
3023
- if (!NextToken ||
3024
- NextToken->isOneOf (tok::arrow, tok::equal, tok::comma, tok::r_paren,
3024
+ if (NextToken->isOneOf (tok::arrow, tok::equal, tok::comma, tok::r_paren,
3025
3025
TT_RequiresClause) ||
3026
3026
(NextToken->is (tok::kw_noexcept) && !IsExpression) ||
3027
3027
NextToken->canBePointerOrReferenceQualifier () ||
@@ -6519,18 +6519,8 @@ TokenAnnotator::getTokenReferenceAlignment(const FormatToken &Reference) const {
6519
6519
FormatStyle::PointerAlignmentStyle
6520
6520
TokenAnnotator::getTokenPointerOrReferenceAlignment (
6521
6521
const FormatToken &PointerOrReference) const {
6522
- if (PointerOrReference.isOneOf (tok::amp, tok::ampamp)) {
6523
- switch (Style.ReferenceAlignment ) {
6524
- case FormatStyle::RAS_Pointer:
6525
- return Style.PointerAlignment ;
6526
- case FormatStyle::RAS_Left:
6527
- return FormatStyle::PAS_Left;
6528
- case FormatStyle::RAS_Right:
6529
- return FormatStyle::PAS_Right;
6530
- case FormatStyle::RAS_Middle:
6531
- return FormatStyle::PAS_Middle;
6532
- }
6533
- }
6522
+ if (PointerOrReference.isOneOf (tok::amp, tok::ampamp))
6523
+ return getTokenReferenceAlignment (PointerOrReference);
6534
6524
assert (PointerOrReference.is (tok::star));
6535
6525
return Style.PointerAlignment ;
6536
6526
}
0 commit comments