UnicodeString::tempSubString delete && overloads#3842
UnicodeString::tempSubString delete && overloads#3842philipp-zimmermann wants to merge 1 commit intounicode-org:mainfrom
Conversation
|
@philipp-zimmermann please sign the CLA. Otherwise we can't look at your proposed changes.
You need to create a Jira account before you can create a ticket. See https://icu.unicode.org/bugs |
Thanks for the Answer. I still have the issue that the Button "+ Create" is red for me and nothing happens when I click on it. I tried the following things to fix the problem:
Nothing worked so far. |
|
We have had a couple of other people also report problems with Jira; we are looking into that. We can create a Jira ticket on your behalf, but we can't look at your changes until you sign the CLA. |
Hi Markus, I forgot to add the mail address associated to the commit to my github account. Now it recognizes that I signed the CLA. |
Changes
The rvalue overloads for
icu::UnicodeString::tempSubStringandicu::UnicodeString::tempSubStringBetweenare deleted.Justification
Calling
tempSubStringon a rvalue violates the precondition ("[...] requires that the original string not be modified or deleted during the lifetime of the returned substring object."). Therefore disallowing usage like this prevents bugs.A example for the buggy behavior is the following code:
This may lead to output like this:
The above output is from a binary compiled with "Release" mode. When using "Debug" the behavior is correct.
This is tested with https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-Ubuntu22.04-x64.tgz.
Jira issue
I am not able to create a new jira issue at all and I'm not able to find a solution for this problem.
TODO: Fill out the checklist below.
Checklist