Skip to content

Commit a4d517d

Browse files
authored
[SystemZ][z/OS] Fix error about const char in Text Encoding (#146727)
This patch fixes the following error: ``` llvm/lib/Support/TextEncoding.cpp:274:11: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *' 274 | char *Input = InputLength ? const_cast<char *>(Source.data()) : ""; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
1 parent 5e6e51b commit a4d517d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Support/TextEncoding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ TextEncodingConverterIconv::convertString(StringRef Source,
271271
// Setup the input. Use nullptr to reset iconv state if input length is
272272
// zero.
273273
size_t InputLength = Source.size();
274-
char *Input = InputLength ? const_cast<char *>(Source.data()) : "";
274+
char *Input = const_cast<char *>(InputLength ? Source.data() : "");
275275
Ret = iconv(ConvDesc, &Input, &InputLength, &Output, &OutputLength);
276276
if (Ret != 0) {
277277
if (auto EC = HandleError(Ret))

0 commit comments

Comments
 (0)