Skip to content

Cannot compile nav2_route using clang #6015

Closed

Description

@solonovamax

Bug report

Required Info:

  • Operating System:
    • Arch Linux 6.18.8-arch2-1 x86_64
  • Computer:
    • not sure what you want here. do you want like my CPU or something? I have an AMD Ryzen 3600.
  • ROS2 Version:
    • Compiling Jazzy from source using nix-ros-overlay, with nav2 configured to compile using clang
  • Version or commit hash:
    • 1.3.11-r1
  • DDS implementation:
    • Fast-RTPS
  • Compiler:
    • Clang 19.1.7

Steps to reproduce issue

Try to compile nav2_route using clang

Expected behavior

Does not fail to compile

Actual behavior

Fails to compile with the following message:

In file included from /build/navigation2-release-release-jazzy-nav2_route-1.3.11-1/src/route_server.cpp:15:
/build/navigation2-release-release-jazzy-nav2_route-1.3.11-1/include/nav2_route/route_server.hpp:132:22: error: non-const lvalue reference to type 'ReroutingState' cannot bind to a temporary of type 'ReroutingState'
  132 |     ReroutingState & rerouting_info = ReroutingState());
      |                      ^                ~~~~~~~~~~~~~~~~
/build/navigation2-release-release-jazzy-nav2_route-1.3.11-1/include/nav2_route/route_server.hpp:132:22: note: passing argument to parameter 'rerouting_info' here

Reproduction instructions

Compile using clang.

Additional information

The issue has to do with this function here:

template<typename GoalT>
Route findRoute(
const std::shared_ptr<const GoalT> goal,
ReroutingState & rerouting_info = ReroutingState());

Related: #5660

Activity

  1. added a commit that references this issue on Mar 6, 2026
    9a6c4c0
  2. SteveMacenski commented on Mar 6, 2026

    @SteveMacenski
    Member

    Reviewing PR - closing :-)

  3. added a commit that references this issue on Mar 6, 2026
    9be661f
  4. added a commit that references this issue on Nov 9, 2026
    de6e415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions