https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93314
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:9b53edc796d284b6adec7f2996772dbddf4c341e commit r11-8181-g9b53edc796d284b6adec7f2996772dbddf4c341e Author: Jason Merrill <ja...@redhat.com> Date: Wed Apr 14 09:30:05 2021 -0400 c++: non-static member, array bound, sizeof [PR93314] N2253 allowed referring to non-static data members without an object in unevaluated operands like that of sizeof, but in a constant-expression context like an array bound or template argument within such an unevaluated operand we do actually need a value, so that permission cannot apply. gcc/cp/ChangeLog: PR c++/93314 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand for a non-static data member in a constant-expression. gcc/testsuite/ChangeLog: PR c++/93314 * g++.dg/parse/uneval1.C: New test.