Punctuation characters need to be escaped in the argument to .Ql, or you end up with the output containing things like ''! rather than '!'. Xavier Renaut reported this in http://bugs.debian.org/191131. I'll attach a patch in a moment.
Created attachment 277 [details] Fix punctuation in argument to .Ql There's a rationale for why \& is needed in the "Other Possible Pitfalls" section of groff_mdoc(7).
Have you considered this to be a bug in groff? This is not producable under any of the BSDs.
It's documented as behaving this way for punctuation characters that end sentences, and as far as I know groff's mdoc implementation is maintained to a large extent by the FreeBSD team, so I rather doubt it. However, I've just asked the groff mailing list for an opinion. I also note that the OpenSSH man pages already use the \& construction in a number of other places for exactly the same reason.
Werner Lemberg, the groff maintainer, says: It's not a bug, it's a logical extension. The old BSD mdoc macros are not consequent here for reasons beyond my knowledge: Look at the `z.', `z,', ... registers in old BSD's doc-common and you can see that `z!' and `z?' are missing, while groff's mdoc has `doc-punct!' and `doc-punct?'. IMHO the OpenSSH team should apply your patch even if not necessary for old BSD's mdoc macros.
Applied upstream along with escaping * while we are here since it is proper, but does not affect us (suggested by jmc of OpenBSD).
Mass change of RESOLVED bugs to CLOSED