llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[clang-tidy]: modernize-use-using duplicates class body when its member has comment

Open e-kwsm opened this issue 1 week ago • 3 comments

clang-tidy 23.1.5

typedef struct {
  int n; ///< comm
} Foo;

typedef struct {
  /// comm
  int n;
} Bar;

clang-tidy --checks=modernize-use-using --fix yields malformed code shown as below:

using Foo = struct {
  int n; ///< comm
} {
  int n; ///< comm
};

using Bar = struct {
  /// comm
  int n;
} {
  /// comm
  int n;
};

https://godbolt.org/z/rzdz61115: add --fix option to see generated code.

e-kwsm avatar Nov 28 '26 00:11 e-kwsm

@llvm/issue-subscribers-clang-tidy

Author: Eisuke Kawashima (e-kwsm)

clang-tidy 23.1.5
typedef struct {
  int n; ///&lt; comm
} Foo;

typedef struct {
  /// comm
  int n;
} Bar;

clang-tidy --checks=modernize-use-using --fix yields malformed code shown as below:

using Foo = struct {
  int n; ///&lt; comm
} {
  int n; ///&lt; comm
};

using Bar = struct {
  /// comm
  int n;
} {
  /// comm
  int n;
};

<https://godbolt.org/z/rzdz61115>: add --fix option to see generated code.

can i work on this?

Neeraj3008 avatar Nov 28 '26 18:11 Neeraj3008

can i work on this?

Just create pull request and mention it on this page.

EugeneZelenko avatar Nov 29 '26 01:11 EugeneZelenko