hyperscan icon indicating copy to clipboard operation
hyperscan copied to clipboard

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

Open niyue opened this issue 5 years ago • 0 comments

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

niyue avatar Nov 01 '20 00:11 niyue