fix deprecated-copy warnings: add assignment operators

Description

Elango built ICU4C with gcc 9.2 and -fsanitize=undefined and got several warnings about assignment operators that are used, and implicitly provided by the compiler, but where only copy constructors are explicitly defined.

We should explicitly define the corresponding assignment operators, too.

Two of the classes are internal:

  • dtptngen_impl.h PtnSkeleton

  • dtptngen_impl.h DateTimeMatcher

One is public:

  • i18n/unicode/numsys.h NumberingSystem

Since the compiler has been implicitly providing the assignment operator, I think we should add it as @stable ICU 4.2.

Example compiler warning:

Activity

Show:
Elango Cheran
April 8, 2020, 9:33 PM

The changes to fix 21033 are included in the work done for https://unicode-org.atlassian.net/browse/ICU-21015

Elango Cheran
April 8, 2020, 9:20 PM

I re-ran the GCC build on maint/maint-67 with the same -fsanitize=undefined flags, and I can verify the desired absence of warnings about the implicit assignment operator.

I did a diff between the output of the make command in the before & after (maint/maint-67) branches just to be extra sure. I saved and uploaded the diff file, just in case.

Markus Scherer
April 8, 2020, 7:30 PM

could you please re-run the gcc -fsanitize=undefined build on the maint/maint-67 branch code and double-check that 's recent PR fixed this issue?

Fixed by Other Ticket
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Markus Scherer

Components

Priority

major

Time Needed

Hours

Fix versions