It is not possible for a pawn to promote on a back-rank square adjacent to the king. This would imply that, before the pawn was pushed to the last rank, the king was on the square forward and diagonal to the pawn. This would, of course, mean that the king either moved into check or failed to move out of check on the previous move.
For example, say on move 36, black wants to play e8=Q+
and the king is on f8
. This means that, before the pawn was pushed to the eighth rank, the pawn was on e7
and the white king was on f8.
This implies that the king either moved into check or failed to move out of check on their last turn. This position you are referring to is impossible in chess.
If, however, the king is on square other than f8
or d8
, say h8
, then yes, assuming no pieces are between the promoted pawn to queen and the white king, the white king would be in check on this next turn.