Skip to content

range-loop-analysis compilation failure when using Xcode command line tools 12.0  #279

@niyue

Description

@niyue

When using Xcode command line tools 12.0, some build compilation failure will occur, reporting error like:

~/vcpkg/buildtrees/chimera/src/5.3.0-6c5c4c3edd.clean/util/ng_corpus_generator.cpp:84:22: error: loop variable 'v' is always a copy because the range of type 'decltype(pair_range(adjacent_vertices(v, g)))' (aka 'iterator_range<ue2::ue2_graph<ue2::NGHolder, ue2::NFAGraphVertexProps, ue2::NFAGraphEdgeProps>::adjacency_iterator>') does not return a  reference [-Werror,-Wrange-loop-analysis]
  59     for (const auto &v : adjacent_vertices_range(g.start, g)) {
......

After some investigation, this issue may be caused by:

  1. llvm added -Wrange-loop-analysis to -Wall (https://reviews.llvm.org/D68912)
  2. the latest Xcode command line tools adopted the new version of llvm, which will report the failure

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