https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97145
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:3f56563cf84f97ef271ef0f949a571c13cdd06e2 commit r10-8850-g3f56563cf84f97ef271ef0f949a571c13cdd06e2 Author: Jakub Jelinek <ja...@redhat.com> Date: Tue Sep 22 21:06:32 2020 +0200 c++: Ignore __sanitizer_ptr_{sub,cmp} builtin calls during constant expression evaluation [PR97145] These two builtin calls are added already during parsing before pointer subtractions or comparisons, normally they perform runtime verification of whether the pointers point to the same object or different objects, but during constant expressione valuation we don't really need those builtins for anything. 2020-09-22 Jakub Jelinek <ja...@redhat.com> PR c++/97145 * constexpr.c (cxx_eval_builtin_function_call): Return void_node for calls to __sanitize_ptr_{sub,cmp} builtins. * g++.dg/asan/pr97145.C: New test. (cherry picked from commit bc13106e0414b86af8f6878e7681e6a959921b9e)