Skip to content

[C++][R] Missing typename in ulp_distance.cc breaks clang-15 builds #50294

Description

@thisisnic

ulp_distance.cc:53 uses a dependent type name without typename, which clang-15 rejects:

https://github.com/apache/arrow/blob/d0919579cb/cpp/src/arrow/util/ulp_distance.cc#L53

/arrow/r/check/arrow.Rcheck/00_pkg_src/arrow/tools/cpp/src/arrow/util/ulp_distance.cc:53:20: error: missing 'typename' prior to dependent type name 'FloatToUInt<Float>::Type'
  using UIntType = FloatToUInt<Float>::Type;
                   ^~~~~~~~~~~~~~~~~~~~~~~~
                   typename 
1 error generated.

From test-r-linux-as-cran nightly run: https://github.com/ursacomputing/crossbow/actions/runs/28413609521

Introduced in PR #49290 (merged Jun 17). Breaking test-r-linux-as-cran nightly since at least June 23.

Note: this only fails on the rhub/ubuntu-clang container which uses clang-15. CRAN's debian-clang now uses clang 22.1.7, so this isn't a real CRAN failure. However, adding the typename keyword is correct C++ practice regardless.

Fix: using UIntType = typename FloatToUInt<Float>::Type;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions