While replacing macros with their definitions (which is wrong, see bug 34412), clang-tidy breaks function pointer types badly. See the following example:
define CDECL __attribute((cdecl))
// BEFORE
typedef void (CDECL FuncType)(int a);
// AFTER
using FuncType = void ()(int) attribute((cdecl)))(int a);
// should be
using FuncType = void (CDECL *)(int a);
I don't know if this only happens when the macro contains an attribute (what with the parentheses), but I don't know what else I'd want to put in there.
| | |
| --- | --- |
| Bugzilla Link | [38498](https://llvm.org/bz38498) |
| Version | unspecified |
| OS | Linux |
| Depends On | llvm/llvm-project#33760 |
| CC | @AaronBallman,@EugeneZelenko,@steveire |
## Extended Description
clang-tidy version: 6.0.0
While replacing macros with their definitions (which is wrong, see bug 34412), clang-tidy breaks function pointer types badly. See the following example:
#define CDECL __attribute((cdecl))
// BEFORE
typedef void (CDECL *FuncType)(int a);
// AFTER
using FuncType = void (*)(int) __attribute__((cdecl)))(int a);
// should be
using FuncType = void (CDECL *)(int a);
I don't know if this only happens when the macro contains an attribute (what with the parentheses), but I don't know what else I'd want to put in there.
Extended Description
clang-tidy version: 6.0.0
While replacing macros with their definitions (which is wrong, see bug 34412), clang-tidy breaks function pointer types badly. See the following example:
define CDECL __attribute((cdecl))
// BEFORE typedef void (CDECL FuncType)(int a); // AFTER using FuncType = void ()(int) attribute((cdecl)))(int a); // should be using FuncType = void (CDECL *)(int a);
I don't know if this only happens when the macro contains an attribute (what with the parentheses), but I don't know what else I'd want to put in there.