[Bug c++/85460] New: g++ does not check incompatible type
zhonghao at pku dot org.cn
gcc-bugzilla@gcc.gnu.org
Thu Apr 19 00:04:00 GMT 2018
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.
More information about the Gcc-bugs
mailing list