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

Fix -Wmissing-template-arg-list-after-template-kw issued by Clang 19 #73

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

dummyunit
Copy link
Contributor

This warning is treated as error by default:
https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-template-arg-list-after-template-kw
So build breaks for all library consumers even when -Werror, -Wall, etc. are not used.

STR:

$ CXX=clang++-19 CC=clang-19 cmake -B build -DATOMIC_QUEUE_BUILD_TESTS=yes &> /dev/null
$ cmake --build build
[  0%] Built target atomic_queue
[ 50%] Building CXX object src/CMakeFiles/atomic_queue_tests.dir/tests.cc.o
In file included from /tmp/atomic_queue/src/tests.cc:8:
/tmp/atomic_queue/include/atomic_queue/atomic_queue.h:407:31: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
  407 |         return Base::template do_pop_any(states_[index], elements_[index]);
      |                               ^
/tmp/atomic_queue/include/atomic_queue/atomic_queue.h:413:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]                                                                                   
  413 |         Base::template do_push_any(std::forward<U>(element), states_[index], elements_[index]);
      |                        ^
/tmp/atomic_queue/include/atomic_queue/atomic_queue.h:538:31: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]                                                                                   
  538 |         return Base::template do_pop_any(states_[index], elements_[index]);
      |                               ^
/tmp/atomic_queue/include/atomic_queue/atomic_queue.h:544:24: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]                                                                                   
  544 |         Base::template do_push_any(std::forward<U>(element), states_[index], elements_[index]);
      |                        ^
4 errors generated.

This warning is treated as error by default:
https://releases.llvm.org/19.1.0/tools/clang/docs/DiagnosticsReference.html#wmissing-template-arg-list-after-template-kw
So build breaks for all library consumers even when -Werror, -Wall, etc. are not used.
@max0x7ba max0x7ba merged commit eaf3037 into max0x7ba:master Oct 1, 2024
8 checks passed
@max0x7ba
Copy link
Owner

max0x7ba commented Oct 1, 2024

Thank you for your contribution.

For some reason, this piece of code came to my mind yesterday, out of the blue, and a question arose why template was there.

@dummyunit dummyunit deleted the clang_19_warnings branch October 2, 2024 22:01
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.

2 participants