cxx11 attributes needs to be placed after function declarator-id for it to be applied to the function declaration. place the attribute after function parameter list will apply the attriutes to the function type, rather than the function declaration itself.