https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105351
Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org --- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> --- (In reply to Gawain Bolton from comment #4) > Finally, this also begs the question as to how one could write a requirement > to ensure a class has a static attribute. One way is to replace the requirement 'T::attr2' with 'typename dummy<&T::attr2>' where 'dummy' is the class template template<auto*> struct dummy; This works because template arguments are constant expressions, and constant expressions are evaluated even in unevaluated contexts, so the bullet point that ensadc pointed out in comment #3 no longer applies. This makes both Clang and GCC happy: https://godbolt.org/z/c8q355hfh