See CPLUSPLUS_CPP_SPEC, e.g., in config/rs6000/aix43.h. You probably need something similar for HP/UX. Mark and I added this macro for exactly this complication of assumptions made by libstdc++v3. David