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

[clang-format] classifies * in template arguments as non-pointer in some cases

Open jvoung opened this issue 1 year ago • 2 comments

For example:

  • std::vector<int* absl_nonnull> x;
  • MyArray<int* absl_nonnull> arr;

For builtin types like int it might be clear that the * is meant to be a pointer. For user-defined types, it might be less clear?

  • MyFixedArray<MyType* absl_nonnull, MySize * MyCount> fixed_arr;

jvoung avatar Mar 10 '25 13:03 jvoung

@llvm/issue-subscribers-clang-format

Author: Jan Voung (jvoung)

For example:
  • std::vector&lt;int* absl_nonnull&gt; x;
  • MyArray&lt;int* absl_nonnull&gt; arr;

For builtin types like int it might be clear that the * is meant to be a pointer. For user-defined types, it might be less clear?

  • MyFixedArray&lt;MyType* absl_nonnull, MySize * MyCount&gt; fixed_arr;

llvmbot avatar Mar 10 '25 13:03 llvmbot

Fixed by #130346

owenca avatar Mar 15 '25 07:03 owenca