microsoft / snmalloc

Message passing based allocator
MIT License
1.58k stars 108 forks source link

[build][clang 19+] `missing-template-arg-list-after-template-kw` is triggered during the build #669

Closed SchrodingerZhu closed 15 hours ago

SchrodingerZhu commented 2 months ago

See https://github.com/SchrodingerZhu/ReuseIR/actions/runs/10536186246/job/29196068023

--- stderr
  In file included from /home/schrodinger/ReuseIR/reuse-runtime/src/allocator.cpp:1:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/snmalloc.h:4:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/snmalloc_core.h:3:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/backend_helpers.h:1:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/../mem/mem.h:3:
  /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/../mem/corealloc.h:498:37: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
    498 |           Config::Backend::template get_metaentry(snmalloc::address_cast(msg));
        |                                     ^
  /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/../mem/corealloc.h:689:35: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
    689 |         Config::Backend::template get_metaentry(snmalloc::address_cast(p));
        |                                   ^
  In file included from /home/schrodinger/ReuseIR/reuse-runtime/src/allocator.cpp:1:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/snmalloc.h:4:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/snmalloc_core.h:3:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/backend_helpers.h:1:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/../mem/mem.h:7:
  In file included from /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/../mem/globalalloc.h:4:
  /home/schrodinger/ReuseIR/target/release/build/reuse-runtime-9fde60c52cd128ae/out/build/_deps/snmalloc-src/src/snmalloc/backend_helpers/../mem/localalloc.h:828:35: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
    828 |         Config::Backend::template get_metaentry(address_cast(p));
        |                                   ^
  3 errors generated.
mjp41 commented 1 month ago

Sorry hadn't spotted this. Should we just add <> like:

Config::Backend::template get_metaentry<>(address_cast(p));

Does that fix the issue? Or can we drop the template keyword in this instance?

SchrodingerZhu commented 1 week ago

@mjp41 removing the template will do the work.

jorisgeer commented 4 days ago

Apparently fixed in main branch