llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.66k stars 11.85k forks source link

clang-format 19-rc1 regression: member function pointers as template arguments #100841

Closed vogelsgesang closed 2 months ago

vogelsgesang commented 2 months ago

In our internal code base, we have a function templated with a member function pointer. Upgrading from clang-format-17 to 19.1.0-rc1, clang-format proposed the following change, which is incorrect / unexpected

-template <llvm::Value* (llvm::IRBuilderBase::*func)(llvm::Value*, llvm::Value*, const llvm::Twine&, bool, bool)>
+template <llvm::Value* (llvm::IRBuilderBase::* func)(llvm::Value*, llvm::Value*, const llvm::Twine&, bool, bool)>
 llvm::Value* LLVMTranslator::generateArithmetic(const IRBinaryOp& op) {
llvmbot commented 2 months ago

@llvm/issue-subscribers-clang-format

Author: Adrian Vogelsgesang (vogelsgesang)

In our internal code base, we have a function templated with a member function pointer. Upgrading from clang-format-17 to 19.1.0-rc1, clang-format proposed the following change, which is incorrect / unexpected ```patch -template <llvm::Value* (llvm::IRBuilderBase::*func)(llvm::Value*, llvm::Value*, const llvm::Twine&, bool, bool)> +template <llvm::Value* (llvm::IRBuilderBase::* func)(llvm::Value*, llvm::Value*, const llvm::Twine&, bool, bool)> llvm::Value* LLVMTranslator::generateArithmetic(const IRBinaryOp& op) { ```
rymiel commented 2 months ago

Bisected to 579dc7f8441a8044b92bdfa6f0db2f91301c0eed. This looks intentional, though

owenca commented 2 months ago

Bisected to 579dc7f. This looks intentional, though

Yeah, IMO it's a bug fix rather than a regression.

tru commented 2 months ago

Can this be closed or removed from the LLVM 19.x milestone?

vogelsgesang commented 2 months ago

Yes, given this was an intentional change, let's close it

owenca commented 1 month ago

Duplicate of #93678.