Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • Project Juggler Project Juggler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 33
    • Issues 33
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • EIC
  • Project JugglerProject Juggler
  • Merge requests
  • !445

TrackParamACTSSeeding::SpacePoint: remove unachievable constexpr

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Dmitry Kalinkin requested to merge pr/constexpr_fix into master Aug 08, 2022
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

The std::hypot and std::pow are not constexpr in the current C++ standards.

Fixes error on clang/libc++:

src/components/TrackParamACTSSeeding.cpp:104:29: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
            constexpr float r() const { return std::hypot(x(), y()); }
                            ^
src/components/TrackParamACTSSeeding.cpp:104:48: note: non-constexpr function 'hypot' cannot be used in a constant expression
            constexpr float r() const { return std::hypot(x(), y()); }
                                               ^
/nix/store/pn15cirhh9m1wzfkjj2jyfa9s2f4483l-libcxx-11.1.0-dev/include/c++/v1/math.h:1255:46: note: declared here
inline _LIBCPP_INLINE_VISIBILITY float       hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::hypotf(__lcpp_x, __lcpp_y);}
                                             ^
src/components/TrackParamACTSSeeding.cpp:105:29: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
            constexpr float varianceR() const
                            ^
src/components/TrackParamACTSSeeding.cpp:107:25: note: non-constexpr function 'pow<float, int>' cannot be used in a constant expression
                return (std::pow(x(), 2) * positionError.xx +
                        ^
libcxx-11.1.0-dev/include/c++/v1/math.h:992:1: note: declared here
pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
^
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: pr/constexpr_fix