Skip to content
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

template argument list is expected after a name prefixed by the template keyword #54

Closed
dcooley opened this issue Sep 18, 2024 · 3 comments

Comments

@dcooley
Copy link

dcooley commented Sep 18, 2024

According to this llvm issue, the template keyword should be followed by an argument list.

There are a few instances where this is not the case, e.g.

https://github.com/boostorg/qvm/blob/develop/include/boost/qvm/quat_traits.hpp#L62 (and L45 72, 82, 92 in that file)

write_quat_element( Q & q, typename quat_traits<Q>::scalar_type s )
    {
    quat_traits<Q>::template write_element<I>(q) = s;
    }

The conversation in the LLVM issue suggests the solution is to remove the template keyword

Clang is correctly rejecting the boost code. The template keyword must be followed by a template-id (i.e. a name followed by template argument list), except when the name refers to a class or alias template (and this use is deprecated).

From a quick look at the code, the template keyword simply should be removed.

e.g: (untested)

write_quat_element( Q & q, typename quat_traits<Q>::scalar_type s )
    {
    quat_traits<Q>::write_element<I>(q) = s;
    }
@zajo
Copy link
Collaborator

zajo commented Sep 19, 2024

Yes, this is a bug, however you had me confused because you linked the wrong function template. The error is in write_quat_element_idx. Thanks for reporting, will fix.

@dcooley
Copy link
Author

dcooley commented Sep 19, 2024

apologies, I thought they all had the issue. But thanks for looking into it.

@zajo
Copy link
Collaborator

zajo commented Sep 20, 2024

Merged in develop.

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

No branches or pull requests

2 participants