pnnl / SHAD

Scalable High-performance Algorithms and Data-structures
Apache License 2.0
122 stars 35 forks source link

fix issue with scope operators in array classes for GCC 11 #226

Closed cychan-lbnl closed 2 years ago

cychan-lbnl commented 2 years ago

Compiling with GCC 11 produces multiple errors similar to the following:

SHAD/include/shad/data_structures/array.h:1496:49: error: expected class-name before '{' token
 1496 |     : public Array<T>::template BaseArrayRef<U> {
      |                                                 ^

Example build output: shad_conan_build.txt

I believe the issue is the compiler doesn't need the Array<T>:: scope operator where it's complaining because both the template class being defined (Array::ArrayRef) and the the template class being referenced (Array::BaseArrayRef) are both in the Array class scope, so using the Array:: scope operator for BaseArrayRef is redundant in the various contexts in which it appears.

This PR removes the Array<T>:: and array<T, N>:: scope operators in data_structures/array.h and core/array.h and the resulting code compiles.