<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55292>55292</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-format SpaceBeforeParens: Always is not always always
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          urnathan
      </td>
    </tr>
</table>

<pre>
    clang-format doesn't always seem to format a space between 'identifier (...' when the docs suggest it should:

Here's an input that I have purposefully spaced at odds with clang-format's behaviour -- it is explicitly inserting spaces as expected, or removing them as unexpected.
```
#define M() 1
#if M () && defined (X) && __has_include ("bob") && __has_cpp_attribute (Y)
#define F(...) __VA_OPT__(__VA_ARGS__)
#endif
void f(){return F(__builtin_LINE () + __builtin_FOO());}
```

```
zathras:49>clang-format --style='{BasedOnStyle: LLVM, SpaceBeforeParens: Always}' fmt.cc
#define M() 1
#if M() && defined(X) && __has_include("bob") && __has_cpp_attribute(Y)
#define F(...) __VA_OPT__ (__VA_ARGS__)
#endif
void f () { return F (__builtin_LINE() + __builtin_FOO ()); }
```

1) That `#if` line doesn't insert a space after any of the function-like macro-ish invocations. 
2) The `__VA_OPT__ (` invocation does (as expected)
3) Known builtin `__builtin_LINE()` has no space, but a random `__builtin_FOO ()` does

The same behaviour with `BasedOnStyle: GNU`, which of course expects the space in these places.

I'd expect a space in all these cases.

(There is no space in the function-like macro definitions, of course)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVW2PozYQ_jXkyyiIQMjLBz4kt7fXVXdvT93rqf2EDB6CW2Mj2yRNf33HQN5ut6s7CYE8M8-8PZ6h0PyYlZKp3bTSpmEOuEargnjpgMkDO1qwiA04DaOegW1ZiVCgOyAqIFPBUTlRCTR0WoVhSDI41KR0NZLDkpx0ux1aB8KBrXUneZBsguguiMb3L2iQUBaYAqHazhGUgj1A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