I recommend that you write a linkdef file so that you can benefit from using the “new”/“current” I/O scheme:
// ag_LinkDef.h
#pragma link C++ class ag_t+;
and using rootcling -f out.cxx ag_t.hh ag_LinkDef.h
even with your existing code this will lead to a dictionary source file that can be compiled … it will still no store the union but will simply warn you at run-time.
Since both union member are double you can work around the limitation with: