Phalanx: "declaration shadows a typedef" warnings emitted by clang
Created by: CamelliaDPG
@trilinos/phalanx
Expectations
Builds with clang that use the -Wshadow
flag should not emit warnings.
Current Behavior
Several such warnings are emitted by clang when building Phalanx_FieldManager_Def.hpp
.
.../include/Phalanx_FieldManager_Def.hpp:223:60: warning: declaration shadows a typedef in 'FieldManager<Traits>' [-Wshadow]
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager.hpp:336:62: note: previous declaration is here
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager_Def.hpp:245:60: warning: declaration shadows a typedef in 'FieldManager<Traits>' [-Wshadow]
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager.hpp:336:62: note: previous declaration is here
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager_Def.hpp:269:60: warning: declaration shadows a typedef in 'FieldManager<Traits>' [-Wshadow]
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager.hpp:336:62: note: previous declaration is here
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager_Def.hpp:314:60: warning: declaration shadows a typedef in 'FieldManager<Traits>' [-Wshadow]
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager.hpp:336:62: note: previous declaration is here
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager_Def.hpp:441:60: warning: declaration shadows a typedef in 'FieldManager<Traits>' [-Wshadow]
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager.hpp:336:62: note: previous declaration is here
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager_Def.hpp:456:60: warning: declaration shadows a typedef in 'FieldManager<Traits>' [-Wshadow]
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
^
.../include/Phalanx_FieldManager.hpp:336:62: note: previous declaration is here
typedef PHX::EvaluationContainer_TemplateManager<Traits> SCTM;
Possible Solution
Since the shadowing typedef is in each case identical to the shadowed typedef, likely the correct solution is simply to delete the shadowing typedef in each case (delete lines 456, 441, 314, 245, and 223).
Environment
I'm building on a Mac using Apple clang 10.0.0.