https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85460
Bug ID: 85460 Summary: g++ does not check incompatible type Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- This is my test case: enum _Ios_Iostate { }; template<typename> struct basic_istream { struct sentry { sentry(basic_istream& ) { _Ios_Iostate __err ; __err |=1; } }; }; g++ does not produce any errors, when 1 is assigned to __err. However, when clang compiles this code, it produces the following message: error: assigning to '_Ios_Iostate' from incompatible type 'int' __err |=1; ^ ~ 1 error generated.