Repository navigation
Conversation
Walkthrough
Merge Risk:
|
|
AcknowlEDG review results updated for
|
|
@coderabbitai full review |
Action performed
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…8967] In GNU C++ mode (including Clang mode), an implicit pointer conversion that adds const below the first level without adding it at every intermediate level (e.g., "char **" to "const char **") was accepted with a warning. GCC and Clang reject it. Make it an error, except where the qualification conversion check does not look through array levels in the emulated mode (GNU C++ before 8.x and Clang), so that const-safe conversions through arrays are still accepted. Add regression tests, including conversions through array levels in Clang and GNU C++ 7 modes, and update the recordings of imported tests that now get the errors their sources expect.
1aa33fa to
e9622d9
Compare
|
AcknowlEDG review results updated for
CI success. |
In GNU C++ mode, including Clang mode, an implicit pointer conversion that adds
constbelow the first level without adding it at every level in between was accepted with a warning. An example ischar **toconst char **. GCC and Clang reject it, and it is not const-safe.In
types.c, the fallback that accepted these conversions no longer applies in GNU C++ mode. One exception remains: when emulating GNU C++ before 8.x or Clang, the qualification conversion check doesn't look through array levels. The new helperqualification_check_skips_arrayskeeps the fallback in that case, so a const-safe conversion through an array, such asdouble *const (*)[3]toconst double *const (*)[3], is still accepted.regressions/edg-28967covers the rejected two- and three-level conversions, andregressions/edg-28967-positivethe valid ones.regressions/edg-28967-arraycovers conversions through array levels with--clang,--gnu_version=70500and--gnu_version=130300.Five imported tests are re-recorded: Clang
p6,cwg23xx,cwg3xxandqualification-conversion, and GCCconversion/qual1. Every new error is on a line the source marks as an error.Tested with the full test suites for edg_x86_64 and edg_x86_64_cp, compared with a run of main, and with the new and changed tests for edg_x86_32 and edg_x86_32_cp.
The
Changesentry uses this PR's number until there is an issue for it.Reported in discussion #297.