Skip to content

Build/C++: exceptions and RTTI requirement blocks -fno-exceptions and -fno-rtti targets #143

Backlog

Description

@clockblocker

Part of #138
Popularity: 3/7 corpus consumers (cuda-quantum, holoscan-sdk, slang-server)

Problem

reflect-cpp (v0.25.0) requires C++ exceptions and RTTI even though its public error-reporting API (rfl::Result<T>) is value-based (expected-style). Large compiler/runtime ecosystems (LLVM/MLIR), WASI builds, and low-level SDK components compile with -fno-exceptions and/or -fno-rtti, forcing consumers either to selectively re-enable -fexceptions -frtti on every TU touching reflect-cpp (and on reflectcpp itself) or to exclude reflect-cpp from exception-free public codec layers altogether.

Observed Downstream Workarounds

NVIDIA/cuda-quantum (90e4aa08)

nvidia-holoscan/holoscan-sdk (358c772f)

hudson-trading/slang-server (1b413a46)

  • slang-server must explicitly append -fexceptions directly onto the reflectcpp target (CMakeLists.txt#L317-L321) and globally enable -fexceptions under WASI (CMakeLists.txt#L125-L126):
    # Suppress warnings in reflect-cpp library
    if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
      target_compile_options(reflectcpp PRIVATE -Wno-missing-field-initializers
                                                -Wno-unused-parameter -fexceptions)
    endif()

Impact

  • Prevents header-only compile-time reflection (rfl::to_view, rfl::enums, rfl::type_name) from being used cleanly inside -fno-exceptions -fno-rtti LLVM/MLIR, WASI, or embedded SDK translation units without per-target flag overrides.

Upstream Overlap

Activity

  1. added
    enhancement
    needs-triage
    known-downstream-workarounds
    on Nov 29, 2026
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

    enhancementknown-downstream-workaroundsneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions