https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92171
Bug ID: 92171 Summary: accept incorrect access of static constexpr member when read from a reference Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jonathan.poelen at gmail dot com Target Milestone: --- #include <type_traits> struct A { static constexpr std::true_type value {}; }; int main() { A a; A& ref = a; constexpr bool r1 = a.value; //ok constexpr bool r2 = ref.value; // this should not work } See https://bugs.llvm.org/show_bug.cgi?id=43732#c1