llvm / llvm/llvm-project

[clang-format] Clang format option to control space inside function pointer declaration

Open
#195,713 1 comment 0 reactions 0 assignees View on GitHub
clang-format
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Hello. Is there clang-format option to control space in function pointer declaration? Currently clang-format adds space between function pointer and return type inside alias

```
using FuncPtr = ReturnType (*)(Args...);
typedef ReturnType (*funcPTr2)(Args...);
```
and I want to keep this formatting
```
using FuncPtr = ReturnType(*)(Args...);
typedef ReturnType(*funcPTr2)(Args...);
```

Contributor guide

Open the contributing guide

Research direction

Start with clang-format by running the two function-pointer examples and reviewing the existing formatting options and documentation. No source file or test is named in the issue, so locate the formatter's relevant spacing behavior first. Done means the requested spacing can be controlled by a documented option and is covered by formatter tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.