Skip to content

Fixes build with Clang 17 #1315

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

michaelknoch
Copy link

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

Copy link

@ephemer ephemer left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
2 participants