Strange behavior of mathtools with showonlyrefs

With the following code :

\documentclass{article}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}

\begin{document}

\begin{align}
A & = B  \label{eq:first}\\
& = C \tag{a}
\end{align}

Reference to \eqref{eq:first}.

\end{document}


I obtain the following result:

With \tag* instead of \tag, I have the expected result.

Of course, it doesn't seem logical to put \tag{a} without the option showmanualtags but the result seems strange.

• It might be a nice puzzle to solve but: (1) I can't see a reason for mixing numbers and manual tags in the same display; (2) I can't see a reason for not showing manual tags unless referred to; (3) I can't see a reason for showonlyrefs. Reasons are in order of importance. – egreg Jul 20 '18 at 11:40