oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

[NFC] add a few missing template keywords

Open kedartal opened this issue 1 year ago • 2 comments

Description

Add a few missing template keywords to fix compilation errors and warnings with a very recent clang 19 (probably due to this LLVM commit in this PR).

This PR only addresses the three specific ones that failed my compilation; more generally an expression of the form

this->base<T>::func()

for some base class template base with a member function func (CRTP) should probably be

this->template base<T>::func()

Example compilation error and warning:

...

In file included from .../include/tbb/combinable.h:17:
In file included from .../oneapi/tbb/combinable.h:22:
.../oneapi/tbb/enumerable_thread_specific.h:882:39: error: no member named 'table_clear' in the global namespace
  882 |         this->ets_base<ETS_key_type>::table_clear();
      |                                     ~~^
.../oneapi/tbb/enumerable_thread_specific.h:882:15: error: cannot refer to type member 'ets_base' in 'tbb::detail::d1::enumerable_thread_specific<T>' with '->'
  882 |         this->ets_base<ETS_key_type>::table_clear();
      |               ^
.../oneapi/tbb/combinable.h:33:7: note: in instantiation of member function 'tbb::detail::d1::enumerable_thread_specific<T>::~enumerable_thread_specific' requested here
   33 | class combinable {
      |       ^
.../oneapi/tbb/enumerable_thread_specific.h:103:7: note: member 'ets_base' declared here
  103 | class ets_base : detail::no_copy {
      |       ^

...

In file included from .../include/tbb/tbb.h:17:
In file included from .../oneapi/tbb.h:49:
In file included from .../include/oneapi/tbb/flow_graph.h:531:
.../include/oneapi/tbb/detail/_flow_graph_node_impl.h:34:22: warning: use 'template' keyword to treat 'item_buffer' as a dependent template name [-Wmissing-dependent-template-keyword]
   34 |         return this->item_buffer<T, A>::front();
      |                      ^
      |                      template 
...

Type of change

  • [x] bug fix - change that fixes an issue
  • [ ] new feature - change that adds functionality
  • [ ] tests - change in tests
  • [ ] infrastructure - change in infrastructure and CI
  • [ ] documentation - documentation update

Tests

  • [ ] added - required for new features and some bug fixes
  • [x] not needed

Documentation

  • [ ] updated in # - add PR number
  • [ ] needs to be updated
  • [x] not needed

Breaks backward compatibility

  • [ ] Yes
  • [ ] No
  • [x] Unknown

Notify the following users

List users with @ to send notifications

Other information

kedartal avatar Jul 12 '24 21:07 kedartal

The newer gcc versions (11.4.0) succeed, while the older gcc versions (9.4.0 and 10.5.0) fail to compile. What is the minimum version of gcc the project aims to support?

I'm not sure about the other major compilers; we could always guard such changes with compiler versioning (something like this), please let me know if you want me to update the PR.

kedartal avatar Jul 12 '24 23:07 kedartal

The newer gcc versions (11.4.0) succeed, while the older gcc versions (9.4.0 and 10.5.0) fail to compile. What is the minimum version of gcc the project aims to support?

I'm not sure about the other major compilers; we could always guard such changes with compiler versioning (something like this), please let me know if you want me to update the PR.

Please see https://github.com/oneapi-src/oneTBB/blob/master/SYSTEM_REQUIREMENTS.md#supported-compilers

dnmokhov avatar Jul 13 '24 21:07 dnmokhov