The following code does not compile:
\documentclass[11pt]{article}
\usepackage{calc}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{p{.5cm}p{\widthof{\textbf{AAAAAAAAA}}}l}
&\textbf{AAAAAAAAA}&XXXXXXXXXXXXXXXXXXXXXX\\
&\textbf{BBBBB}&YYYYYYYYYYYYYYYYYYYYYYY\\
\end{tabular}
\end{document}
However, it does compile, when the line
\usepackage{siunitx}
is omitted. Interchanging the loading order of the packages does not help.
Error message:
! Undefined control sequence. \GenericError ... #4 \errhelp \@err@ ... l.5 ...r}{p{.5cm}p{\widthof{\textbf{AAAAAAAAA}}}l} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.
\usepackage{etoolbox}\robustify\textbf
. – Ulrike Fischer Nov 10 '18 at 9:34