Skip to content

[clang-format] Cannot recognize multiplication semantic of * #99271

@chestnykh

Description

@chestnykh

Consider the following sample

enum X {
        two = 2
};

#define FN(N) \
void fn(void *addr) \
{ \
        __builtin_memset(addr, 0, N * two); \
} \

FN(4)

And .clang-format containing just BasedOnStyle: LLVM

Then we get the output where clang-format made a 'pointer of type N' instead of multiplication:

#define FN(N)                                                                  \
  void fn(void *addr) { __builtin_memset(addr, 0, N *two); }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions