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

@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

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 force-pushed the cherry-pick-extractapi branch from 1397a75 to 5eb5190 Compare December 18, 2025 20:20
@snprajwal
Copy link
Author

@swift-ci please test

@snprajwal snprajwal changed the title Cherry-pick [ExtractAPI] Format typedef params correctly (#171516) 🍒 [ExtractAPI] Format typedef params correctly (llvm#171516) Dec 18, 2025
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