Issue 175241
Summary [clang-format] Confusion between multiplication and pointer
Labels clang-format
Assignees
Reporter carlosgalvezp
    Example: 

```cpp
struct Bar
{
    int a;
    int b;
    int c;
};

struct Foo
{
    static constexpr int kA{};

    Bar const bar{
        kA,
 kA * kA,
        kA * kA * kA
 };
};
```

Becomes:

```cpp
struct Bar {
  int a;
  int b;
  int c;
};

struct Foo {
  static constexpr int kA{};

  Bar const bar{kA, kA *kA, kA * kA * kA};
};
```

[Godbolt](https://godbolt.org/z/Y7xvcTGrK).

Notice the second element of `bar` is formatted as `kA *kA` instead of `kA * kA`, as if it was dereferencing `kA`.

This happens with the default configuration.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to