Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • T Trilinos
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 936
    • Issues 936
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • James Willenbring
  • Trilinos
  • Issues
  • #4291

Closed
Open
Created Jan 29, 2019 by James Willenbring@jmwilleMaintainer

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.

Assignee
Assign to
Time tracking