Sacado: "declaration shadows a typedef" warnings from clang
Created by: CamelliaDPG
@trilinos/sacado
Expectations
Builds with clang that use the -Wshadow
flag should not emit warnings.
Current Behavior
Two such warnings are emitted by clang when building Sacado_trad.hpp
.
.../include/Sacado_trad.hpp:1469:32: warning: declaration shadows a typedef in 'ADcontext<Double>' [-Wshadow]
typedef ADvari<Double> ADVari;
^
.../include/Sacado_trad.hpp:234:32: note: previous declaration is here
typedef ADvari<Double> ADVari;
^
.../include/Sacado_trad.hpp:1508:32: warning: declaration shadows a typedef in 'ADcontext<Double>' [-Wshadow]
typedef ADvari<Double> ADVari;
^
.../include/Sacado_trad.hpp:234:32: note: previous declaration is here
typedef ADvari<Double> ADVari;
Another warning is emitted by clang when building Kokkos_ViewFactory.hpp
:
.../include/Kokkos_ViewFactory.hpp:82:11: warning: declaration shadows a typedef in 'ViewFactory<ViewPack...>' [-Wshadow]
using value_type = typename ResultView::non_const_value_type;
^
.../include/Kokkos_ViewFactory.hpp:74:61: note: previous declaration is here
typedef typename Impl::ViewFactoryType<ViewPack...>::type value_type;
Possible Solution
For Sacado_trad.hpp
, since the shadowing declaration is identical to the shadowed one, likely the correct fix is just to delete the shadowing one (lines 1508 and 1469 of Sacado_trad.hpp
). For Kokkos_ViewFactory.hpp
, it is not as obvious to me what the correct fix is.
Environment
I'm building on a Mac using Apple clang 10.0.0.