https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88628
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- clang++ agrees with g++ here. The lambda expression needs to be instantiated so that it can be evaluated and expressions in discarded statements are not instantiated.