Issue error on invalid arithemtic conversions in C ternary
authorErich Keane <erich.keane@intel.com>
Mon, 20 Jul 2020 15:00:13 +0000 (08:00 -0700)
committerErich Keane <erich.keane@intel.com>
Mon, 20 Jul 2020 15:02:37 +0000 (08:02 -0700)
commit66aff3239849507861d050c013cbe17c4a5781a7
tree4af9f3c9fd4c546b1ae3a3d110a805055ae1de94
parentad8e900cb3c60873e954221816aafc6767222de2
Issue error on invalid arithemtic conversions in C ternary

As reported in PR46774, an invalid arithemetic conversion used in a C
ternary operator resulted in an assertion. This patch replaces that
assertion with a diagnostic stating that the conversion failed.

At the moment, I believe the only case of this happening is _ExtInt
types.
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/ext-int.c [new file with mode: 0644]
clang/test/SemaCXX/ext-int.cpp