@@ -26,12 +26,12 @@ namespace Stockfish {
2626namespace {
2727
2828 template <GenType Type, Direction D>
29- ExtMove* make_promotions (ExtMove* moveList, Square to) {
29+ ExtMove* make_promotions (ExtMove* moveList, [[maybe_unused]] Square to) {
3030
31- if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
31+ if constexpr (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
3232 *moveList++ = make<PROMOTION>(to - D, to, QUEEN);
3333
34- if (Type == QUIETS || Type == EVASIONS || Type == NON_EVASIONS)
34+ if constexpr (Type == QUIETS || Type == EVASIONS || Type == NON_EVASIONS)
3535 {
3636 *moveList++ = make<PROMOTION>(to - D, to, ROOK);
3737 *moveList++ = make<PROMOTION>(to - D, to, BISHOP);
@@ -60,18 +60,18 @@ namespace {
6060 Bitboard pawnsNotOn7 = pos.pieces (Us, PAWN) & ~TRank7BB;
6161
6262 // Single and double pawn pushes, no promotions
63- if (Type != CAPTURES)
63+ if constexpr (Type != CAPTURES)
6464 {
6565 Bitboard b1 = shift<Up>(pawnsNotOn7) & emptySquares;
6666 Bitboard b2 = shift<Up>(b1 & TRank3BB) & emptySquares;
6767
68- if (Type == EVASIONS) // Consider only blocking squares
68+ if constexpr (Type == EVASIONS) // Consider only blocking squares
6969 {
7070 b1 &= target;
7171 b2 &= target;
7272 }
7373
74- if (Type == QUIET_CHECKS)
74+ if constexpr (Type == QUIET_CHECKS)
7575 {
7676 // To make a quiet check, you either make a direct check by pushing a pawn
7777 // or push a blocker pawn that is not on the same file as the enemy king.
@@ -102,7 +102,7 @@ namespace {
102102 Bitboard b2 = shift<UpLeft >(pawnsOn7) & enemies;
103103 Bitboard b3 = shift<Up >(pawnsOn7) & emptySquares;
104104
105- if (Type == EVASIONS)
105+ if constexpr (Type == EVASIONS)
106106 b3 &= target;
107107
108108 while (b1)
@@ -116,7 +116,7 @@ namespace {
116116 }
117117
118118 // Standard and en passant captures
119- if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
119+ if constexpr (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
120120 {
121121 Bitboard b1 = shift<UpRight>(pawnsNotOn7) & enemies;
122122 Bitboard b2 = shift<UpLeft >(pawnsNotOn7) & enemies;
0 commit comments