c++: Avoid UB in signed shift [PR 98625]
authorNathan Sidwell <nathan@acm.org>
Wed, 20 Jan 2021 17:21:02 +0000 (09:21 -0800)
committerNathan Sidwell <nathan@acm.org>
Wed, 20 Jan 2021 19:41:51 +0000 (11:41 -0800)
commit911f797a9be2dc8ef59f5d5bd6d68baf650b8822
tree79b22640e9966fdc154351b77c8273674f2986c1
parente140f5fd3e235c5a37dc99b79f37a5ad4dc59064
c++: Avoid UB in signed shift [PR 98625]

I'd forgotten that left shifting a negative value is UB until C++20.
Insert some casts to do unsigned shifts.

PT c++/98625
gcc/cp/
* module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
signed type.
gcc/cp/module.cc