http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60625
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- For function definitions (nothing to do with templates) the attribute has to come at the beginning, not at the end. Move it right before 'static' and it will compile.