Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vogelsgesang opened this issue Jul 26, 2024 · 6 comments · Fixed by #105043
Closed

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

vogelsgesang opened this issue Jul 26, 2024 · 6 comments · Fixed by #105043
Labels

Comments

@vogelsgesang
Copy link
Member

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
Copy link
Member

llvmbot commented Jul 26, 2024

@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
-template &lt;llvm::Value* (llvm::IRBuilderBase::*func)(llvm::Value*, llvm::Value*, const llvm::Twine&amp;, bool, bool)&gt;
+template &lt;llvm::Value* (llvm::IRBuilderBase::* func)(llvm::Value*, llvm::Value*, const llvm::Twine&amp;, bool, bool)&gt;
 llvm::Value* LLVMTranslator::generateArithmetic(const IRBinaryOp&amp; op) {

@rymiel
Copy link
Member

rymiel commented Jul 27, 2024

Bisected to 579dc7f. This looks intentional, though

@vogelsgesang vogelsgesang changed the title clang-format 19-rc1 regression: ` clang-format 19-rc1 regression: member function pointers as template arguments Jul 27, 2024
@owenca
Copy link
Contributor

owenca commented Jul 27, 2024

Bisected to 579dc7f. This looks intentional, though

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

@tru
Copy link
Collaborator

tru commented Jul 30, 2024

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

@vogelsgesang
Copy link
Member Author

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

@github-project-automation github-project-automation bot moved this from Needs Triage to Done in LLVM Release Status Jul 30, 2024
@EugeneZelenko EugeneZelenko added question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! and removed regression labels Jul 30, 2024
@EugeneZelenko EugeneZelenko removed this from the LLVM 19.X Release milestone Jul 30, 2024
owenca added a commit to owenca/llvm-project that referenced this issue Aug 20, 2024
Also, don't insert a space after ::* for method pointers.

See llvm#86253 (comment).

Fixes llvm#100841.
owenca added a commit that referenced this issue Aug 23, 2024
Also, don't insert a space after ::* for method pointers.

See
#86253 (comment).

Fixes #100841.
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Aug 23, 2024
Also, don't insert a space after ::* for method pointers.

See
llvm#86253 (comment).

Fixes llvm#100841.

(cherry picked from commit 714033a)
@owenca owenca added regression and removed question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! labels Aug 23, 2024
cjdb pushed a commit to cjdb/llvm-project that referenced this issue Aug 23, 2024
Also, don't insert a space after ::* for method pointers.

See
llvm#86253 (comment).

Fixes llvm#100841.
tru pushed a commit to llvmbot/llvm-project that referenced this issue Aug 26, 2024
Also, don't insert a space after ::* for method pointers.

See
llvm#86253 (comment).

Fixes llvm#100841.

(cherry picked from commit 714033a)
@owenca
Copy link
Contributor

owenca commented Aug 27, 2024

Duplicate of #93678.

@owenca owenca added the duplicate Resolved as duplicate label Aug 27, 2024
@EugeneZelenko EugeneZelenko closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

6 participants