https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66027
--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Actually it turns out I already fixed this on mainline. The following hunk should be backported to GCC 5 I guess. Index: ipa-devirt.c =================================================================== --- ipa-devirt.c (revision 223252) +++ ipa-devirt.c (working copy) @@ -1536,6 +1536,7 @@ odr_types_equivalent_p (tree t1, tree t2 break; } case VOID_TYPE: + case NULLPTR_TYPE: break; default: