sfizz icon indicating copy to clipboard operation
sfizz copied to clipboard

Fixes build with Clang 17

Open michaelknoch opened this issue 8 months ago • 1 comments

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<T>(...)). 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 https://github.com/sfztools/sfizz/issues/1305

Screenshot

Screenshot 2025-04-10 at 23 39 25

michaelknoch avatar Apr 10 '25 22:04 michaelknoch

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

geraintluff avatar Oct 07 '25 21:10 geraintluff