Cache(?) bug in typeof

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=2361

Reported by Martin Stjernholm mast@roxen.com

Consider this program:

    class X {}
    X x;

    int main()
    {
      werror ("%O\n", typeof (x));
      werror ("%O\n", typeof (X));
    }

It writes:

object(implements 65586)
object(implements 65586)

Now swap the two werror lines. The output then becomes:

function( : object(is 65586))
function( : object(is 65586))

Problem exists in 7.2 and 7.3.