It seems that gcc 4.6 and up has a problem with compiling the isnan function.
I find that simply referring to the namespace explicitly solves it.
I had to make similar changes in Carpet/CarpetLib/src/defs.hh, but there I had to fix isinf as well. Probably the isnormal, copysign, etc. functions should get std:: for consistency.