错误如下:
FAILED: obj/src/mpl2mpl/src/libmpl2mpl.reflection_analysis.o
/usr/bin/clang++ -I../src/maple_ir/include -I../src/maple_me/include -I../src/maple_ipa/include -I../src/maple_phase/include -I../src/maple_util/include -I../src/mpl2mpl/include -I../src/mempool/include -I../src/huawei_secure_c/include -O3 -Wall -fstack-protector-strong -fPIC -fPIE -m64 -DDYNAMICLANG -DRC_NO_MMAP -DMIR_FEATURE_FULL=1 -DMIR_JAVA=1 -std=c++14 -Werror -MD -MT obj/src/mpl2mpl/src/libmpl2mpl.reflection_analysis.o -MF obj/src/mpl2mpl/src/libmpl2mpl.reflection_analysis.o.d -o obj/src/mpl2mpl/src/libmpl2mpl.reflection_analysis.o -c ../src/mpl2mpl/src/reflection_analysis.cpp
../src/mpl2mpl/src/reflection_analysis.cpp:1193:20: error: loop variable 'kTyIdx' of type 'const maple::TyIdx' creates a copy from type 'const maple::TyIdx' [-Werror,-Wrange-loop-construct]
for (TyIdx const kTyIdx : classType->GetInerfaceImplemented()) {
^
../src/mpl2mpl/src/reflection_analysis.cpp:1193:8: note: use reference type 'const maple::TyIdx &' to prevent copying
for (TyIdx const kTyIdx : classType->GetInerfaceImplemented()) {
^~~~~~~~~~~~~~~~~~~~
&
意思是:../src/mpl2mpl/src/reflection_analysis.cpp第1193行的这个TyIdx 变量防止复制。
这个要怎么解决?