1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/AI
Sergei Trofimovich c2c352c6dd AI/Nullkiller/Goals/ExecuteHeroChain.cpp: catch polymorphic exceptions by reference
The suspicious code was detected by `gcc-13` as:

    AI/Nullkiller/Goals/ExecuteHeroChain.cpp: In member function 'virtual void NKAI::Goals::ExecuteHeroChain::accept(NKAI::AIGateway*)':
    AI/Nullkiller/Goals/ExecuteHeroChain.cpp:130:47: warning: catching polymorphic type 'class NKAI::cannotFulfillGoalException' by value [-Wcatch-value=]
      130 |                                         catch(cannotFulfillGoalException)
          |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
    AI/Nullkiller/Goals/ExecuteHeroChain.cpp:176:23: warning: catching polymorphic type 'class NKAI::goalFulfilledException' by value [-Wcatch-value=]
      176 |                 catch(goalFulfilledException)
          |                       ^~~~~~~~~~~~~~~~~~~~~~

Similar to object passing by value and reference passing polymorphic
exceptions by reference likely destroys them when copy-constructed to
a base class. Let's catch them by reference.
2022-12-17 21:50:57 +00:00
..
BattleAI Battle AI: add some comments + refactoring 2022-10-23 11:41:03 +03:00
EmptyAI vcmi can be compiled as single app on Linux 2022-12-05 21:36:02 +02:00
FuzzyLite@9751a751a1 AI: replace SectorMap with new PathfinderManager 2018-10-06 16:35:31 +03:00
Nullkiller AI/Nullkiller/Goals/ExecuteHeroChain.cpp: catch polymorphic exceptions by reference 2022-12-17 21:50:57 +00:00
StupidAI merge launcher and client 2022-09-24 15:55:22 +03:00
VCAI use ArtifactID 2022-11-29 00:32:18 +02:00
CMakeLists.txt CMake presets. (#744) 2022-05-26 08:55:20 +03:00
FuzzyLite.cbp [C::B] Switch to MinGW 7.3 2019-02-19 14:59:10 +03:00
GeniusAI.brain Various fixes. Temporarily replaced neural network's output with random number. 2009-08-21 18:18:52 +00:00