Issue 133089
Summary [clang-format] AllowShortFunctionsOnASingleLine=Inline does not respect macros
Labels clang-format
Assignees
Reporter rafzi
    I stumbled upon https://github.com/llvm/llvm-project/issues/60627 which describes this same issue. Over there, the conclusion seems to be wont-fix because the intention of the related change (https://reviews.llvm.org/D117142) was to fix exactly the reported case.

However, I'd argue that a slight modification to the example is an unintended regression. If macros hide the "class" token, the scope is not correctly detected.

```
#define MY_THING(name) class name##Thing final
MY_THING(Foo)
{
    int func() { return 7; }
}
```

is formatted to:

```
#define MY_THING(name) class name##Thing final
MY_THING(Foo)
{
    int func()
    {
        return 7;
 }
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to