Disable some clang conversion warnings in cpp2util.h
and cppfront itself
#1212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR disables some clang conversion warnings in 2 places:
cpp2util.h
for Cpp2 usersThe warnings appear when compiling with clang with
-Wconversion
(as recommend by Jason Turner).cpp2util.h
disablesWsign-conversion
(only in that header) to allow warning-free signed integer types for indices and sizes.The cppfront translation unit (via
common.h
) disables the above and alsoWstring-conversion
to enable implicit conversions of string literals to bools forassert(!"message")
.Some regression tests are updated because the line numbers have changed in
cpp2util.h
.Note: there are some other 64-bit to 32-bit precision loss conversion warnings in cppfront itself (which this PR doesn't address) but I think we should fix them via casts rather than disabling the warning, since that warning may find other issues in the future.