https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72756
Bug ID: 72756 Summary: Using an enum as a constant expression via dot operator should not compile. Product: gcc Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: claas.bontus at web dot de Target Milestone: --- This is a follow up from discussion at http://stackoverflow.com/q/38398475/3876684 The following should not compile, since enum m is accessed via dot operator at //1. Compiler should at least emit a warning. template<size_t n> struct A{}; template<size_t n> struct tst { enum : size_t { m= n % 15 }; template<size_t p> void call( tst<p> const &t2 ) { A<t2.m> a; // 1 } };