http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50344
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-09 19:47:42 UTC --- both testcases are fixed simply by adding this to the top of make_friend_class in friend.c friend_type = cv_unqualified (friend_type);