diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-18 12:34:25 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-18 12:48:38 -0800 |
commit | 9f964b728151066dd37dd80269ed23ea4b4cdeab (patch) | |
tree | 4dcde4880c175d6b2d1ef4903eaf6b746cda8836 /tests/common-real-int-sign.c | |
parent | 27e77f6ca6872c8d332c2e153773ca226d69fb64 (diff) |
Fix compatible check for basic types
This check was only supposed to return true for enum types and their
corresponding integer type. However, it had the side effect of making
'int' compatible with 'unsigned'.
To fix this, introduce a new basic type kind for enums with the same
rank as 'int', that is only compatible with itself and the 'int' type
with the matching sign.
Thanks to Andrew Chambers for the bug report.
Diffstat (limited to 'tests/common-real-int-sign.c')
-rw-r--r-- | tests/common-real-int-sign.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/common-real-int-sign.c b/tests/common-real-int-sign.c new file mode 100644 index 0000000..d67c301 --- /dev/null +++ b/tests/common-real-int-sign.c @@ -0,0 +1,4 @@ +int main(void) { + unsigned x = -1; + return 0 > x; +} |