ECM8 (716c001f) does not compile when ENABLE_INTER_TEMPLATE_MATCHING off

Setting macro ENABLE_INTER_TEMPLATE_MATCHING off leads to compiling errors. Part of the log is copied below.

[ 63%] Building CXX object source/Lib/CommonLib/CMakeFiles/CommonLib.dir/x86/avx2/AdaptiveLoopFilter_avx2.cpp.o
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.cpp:10188:1: error: ‘void PU::fillMvpCand(PredictionUnit&, const RefPicList&, const int&, AMVPInfo&)’ should have been declared inside ‘PU’
10188 | )
      | ^
[ 64%] Building CXX object source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/CommonLib/x86/avx2/RdCost_avx2.cpp.o
[ 64%] Building CXX object source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/CommonLib/x86/avx2/TrQuant_avx2.cpp.o
[ 65%] Building CXX object source/Lib/CommonAnalyserLib/CMakeFiles/CommonAnalyserLib.dir/__/libmd5/libmd5.cpp.o
[ 66%] Building CXX object source/Lib/CommonLib/CMakeFiles/CommonLib.dir/x86/avx2/AffineGradientSearch_avx2.cpp.o
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.cpp: In function ‘void PU::applyImv(PredictionUnit&, MergeCtx&, InterPrediction*)’:
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.cpp:15607:24: error: call of overloaded ‘fillMvpCand(PredictionUnit&, RefPicList, int8_t&, AMVPInfo&)’ is ambiguous
15607 |         PU::fillMvpCand(pu, REF_PIC_LIST_0, pu.refIdx[0], amvpInfo
      |         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15608 | #if TM_AMVP
      | ~~~~~~~~~~~             
15609 |                       , interPred
      |                       ~~~~~~~~~~~
15610 | #endif
      | ~~~~~~                  
15611 |           );
      |           ~             
In file included from /usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.cpp:38:
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.h:295:8: note: candidate: ‘void PU::fillMvpCand(PredictionUnit&, const RefPicList&, const int&, AMVPInfo&, InterPrediction*)’
  295 |   void fillMvpCand                    (      PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AMVPInfo &amvpInfo
      |        ^~~~~~~~~~~
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.cpp:10184:6: note: candidate: ‘void PU::fillMvpCand(PredictionUnit&, const RefPicList&, const int&, AMVPInfo&)’
10184 | void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AMVPInfo &amvpInfo
      |      ^~
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.cpp:15664:22: error: call of overloaded ‘fillMvpCand(PredictionUnit&, RefPicList, int8_t&, AMVPInfo&)’ is ambiguous
15664 |       PU::fillMvpCand(pu, REF_PIC_LIST_1, pu.refIdx[1], amvpInfo
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15665 | #if TM_AMVP
      | ~~~~~~~~~~~           
15666 |                     , interPred
      |                     ~~~~~~~~~~~
15667 | #endif
      | ~~~~~~                
15668 |       );
      |       ~               
/usr/local/google/home/xlxiangli/program/g-ecm/source/Lib/CommonLib/UnitTools.h:295:8: note: candidate: ‘void PU::fillMvpCand(PredictionUnit&, const RefPicList&, const int&, AMVPInfo&, InterPrediction*)’