@@ -1089,7 +1089,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
1089
1089
1090
1090
if (End) {
1091
1091
Parsed.push_back (New<TextPiece>(Text.slice (0 , End), " diagtext" ));
1092
- Text = Text.slice (End, StringRef::npos );
1092
+ Text = Text.substr (End);
1093
1093
if (Text.empty ())
1094
1094
break ;
1095
1095
}
@@ -1103,7 +1103,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
1103
1103
// Extract the (optional) modifier.
1104
1104
size_t ModLength = Text.find_first_of (" 0123456789<{" );
1105
1105
StringRef Modifier = Text.slice (0 , ModLength);
1106
- Text = Text.slice (ModLength, StringRef::npos );
1106
+ Text = Text.substr (ModLength);
1107
1107
ModifierType ModType = StringSwitch<ModifierType>{Modifier}
1108
1108
.Case (" select" , MT_Select)
1109
1109
.Case (" enum_select" , MT_EnumSelect)
@@ -1154,7 +1154,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
1154
1154
Text = Text.drop_front (); // Drop '<'
1155
1155
size_t EnumNameLen = Text.find_first_of (' >' );
1156
1156
EnumSelect->EnumName = Text.slice (0 , EnumNameLen);
1157
- Text = Text.slice (EnumNameLen, StringRef::npos );
1157
+ Text = Text.substr (EnumNameLen);
1158
1158
ExpectAndConsume (" >" );
1159
1159
1160
1160
if (Text[0 ] != ' {' )
@@ -1169,7 +1169,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
1169
1169
Text = Text.drop_front (); // '%'
1170
1170
size_t OptionNameLen = Text.find_first_of (" {" );
1171
1171
EnumSelect->OptionEnumNames .push_back (Text.slice (0 , OptionNameLen));
1172
- Text = Text.slice (OptionNameLen, StringRef::npos );
1172
+ Text = Text.substr (OptionNameLen);
1173
1173
} else {
1174
1174
EnumSelect->OptionEnumNames .push_back ({});
1175
1175
}
@@ -1206,7 +1206,7 @@ Piece *DiagnosticTextBuilder::DiagText::parseDiagText(StringRef &Text,
1206
1206
assert (!Text.empty ());
1207
1207
Plural->OptionPrefixes .push_back (
1208
1208
New<TextPiece>(Text.slice (0 , End), " diagtext" ));
1209
- Text = Text.slice (End, StringRef::npos );
1209
+ Text = Text.substr (End);
1210
1210
Plural->Options .push_back (
1211
1211
parseDiagText (Text, StopAt::PipeOrCloseBrace));
1212
1212
assert (!Text.empty () && " malformed %plural" );
0 commit comments