http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59554
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I don't see the problem with gcc's behavior here. The pointer type that you pass to the template is not not const or volatile. Only what the pointer points to is const and volatile. What output did you expect and why?