From 5c8ba96a54feaf9bb783bb165bce91ee0c3253f9 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Thu, 12 Mar 2020 22:42:29 +0000 Subject: [PATCH] r600: Fix build error in sfn_nir_lower_fs_out_to_vector.cpp In trying a full build under AOSP, I ran into the following error: In file included from external/mesa3d/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp:33: external/libcxx/include/set:942:26: error: the specified comparator type does not provide a const call operator [-Werror,-Wuser-defined-warnings] static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); ^ external/mesa3d/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp:78:34: note: in instantiation of template class 'std::__1::multiset >' requested here using InstrSubSet = std::pair; ^ external/libcxx/include/__tree:967:5: note: from 'diagnose_if' attribute on '__diagnose_non_const_comparator': _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ external/libcxx/include/__config:1244:21: note: expanded from macro '_LIBCPP_DIAGNOSE_WARNING' __attribute__((diagnose_if(__VA_ARGS__, "warning"))) ^ ~~~~~~~~~~~ 1 error generated. Which is pretty opaque to me, but searching the web suggested adding a cost, which seems to resovle it. Reviewed-by: Gert Wollny Signed-off-by: John Stultz Tested-by: Marge Bot Part-of: --- src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp b/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp index 4441a47dfce..818c1f22566 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp @@ -42,7 +42,7 @@ using std::vector; using std::array; struct nir_intrinsic_instr_less { - bool operator () (const nir_intrinsic_instr *lhs, const nir_intrinsic_instr *rhs) + bool operator () (const nir_intrinsic_instr *lhs, const nir_intrinsic_instr *rhs) const { nir_variable *vlhs = nir_deref_instr_get_variable(nir_src_as_deref(lhs->src[0])); nir_variable *vrhs = nir_deref_instr_get_variable(nir_src_as_deref(rhs->src[0])); -- 2.30.2