HomePhabricator

clang-format: Fix pointer alignment for overloaded operators (PR45107)

Authored by hans on Mar 25 2020, 9:20 AM.

Description

clang-format: Fix pointer alignment for overloaded operators (PR45107)

This fixes a regression from D69573 which broke the following example:

$ echo 'operator C<T>*();' | bin/clang-format --style=Chromium
operator C<T> *();

(There should be no space before the asterisk.)

It seems the problem is in TokenAnnotator::spaceRequiredBetween(),
which only looked at the token to the left of the * to see if it was a
type or not. That code only handled simple types or identifiers, not
templates or qualified types. This patch addresses that.

Differential revision: https://reviews.llvm.org/D76850

Details

Committed
hansMar 27 2020, 2:47 AM
Differential Revision
D76850: clang-format: Fix pointer alignment for overloaded operators (PR45107)
Parents
rG7d482e921353: Fix TBAA for unsigned fixed-point types
Branches
Unknown
Tags
Unknown