Skip to content

modernize-use-using breaks certain function pointer types with macros #37846

@PeterFeicht

Description

@PeterFeicht
Bugzilla Link 38498
Version unspecified
OS Linux
Depends On #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.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillaclang-tidyconfirmedVerified by a second party

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions