Consider an elisp file containing this:
(eval-when-compile
(defvar x (cl-macroexpand-all '(eval-when-compile
(error "evaluated"))))
nil)
If this is byte compiled in XEmacs 21.4.6, the error "evaluated" is
signalled inside the byte compiler. It turns out that the content of
the `eval-when-compile' is evaluated during the `cl-macroexpand-all'
call. I did not expect `error' to be evaluated at that point since
it's a function and not a macro.
This is a regression from (at least) XEmacs 20.4 and 19.16, where x is
simply assigned the quoted value (error "evaluated") at compile time.
FSF Emacs also works that way.