Skip to content

Conversation

@snprajwal
Copy link

Typically, pointer types are formatted in a way where the identifier comes right after the type definition without a space separating them, e.g. int *foo, where the type is int * and the identifier is foo. However, if a type alias to a pointer type is used, the emitted declaration fragments are incorrect due to the missing space between the type and identifier, like in the below example:

typedef int *T;
// The declaration fragment contains `Tbar` instead of `T bar`
void foo(T bar);

This patch checks if pointer types are aliased, and inserts the space correctly if so.

rdar://132022003

Cherry-picked from 794218b

Typically, pointer types are formatted in a way where the identifier
comes right after the type definition without a space separating them,
e.g. `int *foo`, where the type is `int *` and the identifier is `foo`.
However, if a type alias to a pointer type is used, the emitted
declaration fragments are incorrect due to the missing space between the
type and identifier, like in the below example:

```
typedef int *T;
// The declaration fragment contains `Tbar` instead of `T bar`
void foo(T bar);
```

This patch checks if pointer types are aliased, and inserts the space
correctly if so.

rdar://132022003
@snprajwal snprajwal requested a review from a team as a code owner December 12, 2025 22:59
@snprajwal
Copy link
Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant