From 78aa463da602eedf0ac0b26464d52a94360ad9ce Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Thu, 3 Dec 2020 09:49:21 -0700 Subject: [PATCH] Fix compile error when template parameter shadows superclass I'm too lazy to look up the C++ spec, but it seems like template parameter names would shadow the same names from a superclass. Apparently that is not the case for Visual Studio. The `Storage` for the cast array inherits from the `Storage` of the transform array. The latter declares a private type named `SourceStorage`, and that is being used instead of the former's `SourceStorage` template parameter. You then get an error for accessing a private member that you did not want in the first place. Fix the problem by changing the name of the template parameter. --- vtkm/cont/ArrayHandleCast.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vtkm/cont/ArrayHandleCast.h b/vtkm/cont/ArrayHandleCast.h index c7ba8e46a..140dcc7a9 100644 --- a/vtkm/cont/ArrayHandleCast.h +++ b/vtkm/cont/ArrayHandleCast.h @@ -119,12 +119,12 @@ struct ArrayHandleCastTraits } // namespace detail -template -struct Storage> - : detail::ArrayHandleCastTraits::StorageSuperclass +template +struct Storage> + : detail::ArrayHandleCastTraits::StorageSuperclass { using Superclass = - typename detail::ArrayHandleCastTraits::StorageSuperclass; + typename detail::ArrayHandleCastTraits::StorageSuperclass; using Superclass::Superclass; };