I want to provide a symbol in math mode with a character above – like \tilde{...} or \hat{...}. I'm using that symbol sometimes with subscript indices as well as with superscript indices. The idea with the character above came that they do not interfere optically with the indices.

My first solution with \overset{\omega}{\phi} did not work, because the vertical alignment of a superscript includes the whole construction while it should only regard the lower, big character. After some internet search I found the accent package as a solution with \accentset{\omega}{\phi}, which indeed delivers the correct alignment. But when I want to pack it inside a glossaryentry from the glossaries package,