https://github.com/llvm/llvm-project/issues/27037
Sorry its taken so long to get to this issue! (got it before it hit its 6th birthday!)
void operator delete(void *foo)ATTRIB;
(void *foo) is incorrectly determined to be a C-Style Cast resulting in the space being removed after the ) and before the attrib, due to the detection of
delete (A* )a;
The following was previously unaffected
void operator new(void *foo) ATTRIB;
Fixes #27037
The current solution looks a bit like a hack to me.
Unless I'm mistaken, casts can appear only in expressions, but not in declarations (except for inside decltype stuff in templates or concepts, but these are still expressions at this level).
Given that void operator delete... is not an expression but a declaration, we shouldn't check rParenEndsCast in this case at all, no?
So, would it be possible to check here for e.g. Line.MightBeFunctionDecl or something like this to avoid it?
Also, how is it that you don't need to special-case new operator?