Skip to content
This repository was archived by the owner on Jun 21, 2026. It is now read-only.

Fixes build with Clang 17#1315

Open
michaelknoch wants to merge 1 commit into
sfztools:developfrom
michaelknoch:codespace-turbo-pancake-55656x9rwvf4gx6
Open

Fixes build with Clang 17#1315
michaelknoch wants to merge 1 commit into
sfztools:developfrom
michaelknoch:codespace-turbo-pancake-55656x9rwvf4gx6

Conversation

@michaelknoch

Copy link
Copy Markdown

Description

This PR fixes invalid use of 'template' keyword when calling do_pop_any in atomic_queue.h

While do_pop_any is a function template, Clang 17 fails to compile the following call:

Base::template do_pop_any(states_[index], elements_[index]);

with error error: a template argument list is expected after a name prefixed by the 'template' keyword

This is because the template keyword is only allowed when explicitly specifying template arguments (e.g., Base::template do_pop_any(...)). In this case, template argument deduction is used, so the template keyword must not be present. This change adheres to the C++ language rules regarding dependent names and member function templates. Other calls that explicitly specify template arguments (like do_pop_atomic<T, NIL>) continue to use the template keyword correctly.

Potentially fixes #1305

Screenshot

Screenshot 2025-04-10 at 23 39 25

@ephemer ephemer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@geraintluff

Copy link
Copy Markdown

Verified that this is a problem for Clang 17, and that this change fixes it.

@paulfd

paulfd commented May 10, 2026

Copy link
Copy Markdown
Member

Thanks for the PR and sorry for the delay. I'll try to look into this as soon as I can. I except most CI pipelines would also be broken so I won't just try to run them to check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails with clang-19: a template argument list is expected after a name prefixed by the template keyword

4 participants