Fix static_assert.
authorDieter Dobbelaere <dieter.dobbelaere@gmail.com>
Sun, 10 Jan 2021 11:22:52 +0000 (12:22 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 11 Jan 2021 18:23:05 +0000 (19:23 +0100)
With a hard-coded true, this declaration has no effect.

closes https://github.com/official-stockfish/Stockfish/pull/3295

No functional change.

src/movegen.cpp

index 5ce2de7c6baa789ed335bc21de24d1ae03249e90..aaa1ff88bdb810b9cf05950a4bf4bc4d43e720ab 100644 (file)
@@ -204,6 +204,9 @@ namespace {
 
   template<Color Us, GenType Type>
   ExtMove* generate_all(const Position& pos, ExtMove* moveList) {
+
+    static_assert(Type != LEGAL, "Unsupported type in generate_all()");
+
     constexpr bool Checks = Type == QUIET_CHECKS; // Reduce template instantations
     Bitboard target, piecesToMove = pos.pieces(Us);
 
@@ -228,8 +231,6 @@ namespace {
         case NON_EVASIONS:
             target = ~pos.pieces(Us);
             break;
-        default:
-            static_assert(true, "Unsupported type in generate_all()");
     }
 
     moveList = generate_pawn_moves<Us, Type>(pos, moveList, target);