http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #2 from Keean Schupke <ke...@fry-it.com> 2012-06-04 13:33:38 UTC --- The function called in the template definition is clearly dependent on the template parameter 'T' and therefore itsname should be resolved at the point of instantiation where 'g' is clearly defined and in scope (and is not local). The error message says: "no declarations were found by argument-dependent lookup at the point of instantiation" when 'g' should be found. See Technicalities C.13.8