Skip to content

Commit a9a60f2

Browse files
committed
[Clang] Rename StringLiteral::isAscii() => isOrdinary() [NFC]
"Ascii" StringLiteral instances are actually narrow strings that are UTF-8 encoded and do not have an encoding prefix. (UTF8 StringLiteral are also UTF-8 encoded strings, but with the u8 prefix. To avoid possible confusion both with actuall ASCII strings, and with future works extending the set of literal encodings supported by clang, this rename StringLiteral::isAscii() to isOrdinary(), matching C++ standard terminology. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D128762
1 parent a7d6c3e commit a9a60f2

23 files changed

+54
-52
lines changed

clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool containsEscapedCharacters(const MatchFinder::MatchResult &Result,
4444
const StringLiteral *Literal,
4545
const CharsBitSet &DisallowedChars) {
4646
// FIXME: Handle L"", u8"", u"" and U"" literals.
47-
if (!Literal->isAscii())
47+
if (!Literal->isOrdinary())
4848
return false;
4949

5050
for (const unsigned char C : Literal->getBytes())

clang-tools-extra/clangd/refactor/tweaks/RawStringLiteral.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ REGISTER_TWEAK(RawStringLiteral)
4646
static bool isNormalString(const StringLiteral &Str, SourceLocation Cursor,
4747
SourceManager &SM) {
4848
// All chunks must be normal ASCII strings, not u8"..." etc.
49-
if (!Str.isAscii())
49+
if (!Str.isOrdinary())
5050
return false;
5151
SourceLocation LastTokenBeforeCursor;
5252
for (auto I = Str.tokloc_begin(), E = Str.tokloc_end(); I != E; ++I) {

clang/include/clang/AST/Expr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ class StringLiteral final
17861786
/// * An array of getByteLength() char used to store the string data.
17871787

17881788
public:
1789-
enum StringKind { Ascii, Wide, UTF8, UTF16, UTF32 };
1789+
enum StringKind { Ordinary, Wide, UTF8, UTF16, UTF32 };
17901790

17911791
private:
17921792
unsigned numTrailingObjects(OverloadToken<unsigned>) const { return 1; }
@@ -1883,7 +1883,7 @@ class StringLiteral final
18831883
return static_cast<StringKind>(StringLiteralBits.Kind);
18841884
}
18851885

1886-
bool isAscii() const { return getKind() == Ascii; }
1886+
bool isOrdinary() const { return getKind() == Ordinary; }
18871887
bool isWide() const { return getKind() == Wide; }
18881888
bool isUTF8() const { return getKind() == UTF8; }
18891889
bool isUTF16() const { return getKind() == UTF16; }

clang/include/clang/Lex/LiteralSupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class CharLiteralParser {
198198
tok::TokenKind kind);
199199

200200
bool hadError() const { return HadError; }
201-
bool isAscii() const { return Kind == tok::char_constant; }
201+
bool isOrdinary() const { return Kind == tok::char_constant; }
202202
bool isWide() const { return Kind == tok::wide_char_constant; }
203203
bool isUTF8() const { return Kind == tok::utf8_char_constant; }
204204
bool isUTF16() const { return Kind == tok::utf16_char_constant; }
@@ -263,7 +263,7 @@ class StringLiteralParser {
263263
/// checking of the string literal and emit errors and warnings.
264264
unsigned getOffsetOfStringByte(const Token &TheTok, unsigned ByteNo) const;
265265

266-
bool isAscii() const { return Kind == tok::string_literal; }
266+
bool isOrdinary() const { return Kind == tok::string_literal; }
267267
bool isWide() const { return Kind == tok::wide_string_literal; }
268268
bool isUTF8() const { return Kind == tok::utf8_string_literal; }
269269
bool isUTF16() const { return Kind == tok::utf16_string_literal; }

clang/lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11901,7 +11901,7 @@ ASTContext::getPredefinedStringLiteralFromCache(StringRef Key) const {
1190111901
StringLiteral *&Result = StringLiteralCache[Key];
1190211902
if (!Result)
1190311903
Result = StringLiteral::Create(
11904-
*this, Key, StringLiteral::Ascii,
11904+
*this, Key, StringLiteral::Ordinary,
1190511905
/*Pascal*/ false, getStringLiteralArrayType(CharTy, Key.size()),
1190611906
SourceLocation());
1190711907
return Result;

clang/lib/AST/Expr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ unsigned StringLiteral::mapCharByteWidth(TargetInfo const &Target,
10231023
StringKind SK) {
10241024
unsigned CharByteWidth = 0;
10251025
switch (SK) {
1026-
case Ascii:
1026+
case Ordinary:
10271027
case UTF8:
10281028
CharByteWidth = Target.getCharWidth();
10291029
break;
@@ -1123,7 +1123,8 @@ StringLiteral *StringLiteral::CreateEmpty(const ASTContext &Ctx,
11231123

11241124
void StringLiteral::outputString(raw_ostream &OS) const {
11251125
switch (getKind()) {
1126-
case Ascii: break; // no prefix.
1126+
case Ordinary:
1127+
break; // no prefix.
11271128
case Wide: OS << 'L'; break;
11281129
case UTF8: OS << "u8"; break;
11291130
case UTF16: OS << 'u'; break;
@@ -1231,7 +1232,7 @@ StringLiteral::getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
12311232
const LangOptions &Features,
12321233
const TargetInfo &Target, unsigned *StartToken,
12331234
unsigned *StartTokenByteOffset) const {
1234-
assert((getKind() == StringLiteral::Ascii ||
1235+
assert((getKind() == StringLiteral::Ordinary ||
12351236
getKind() == StringLiteral::UTF8) &&
12361237
"Only narrow string literals are currently supported");
12371238

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8783,7 +8783,7 @@ class PointerExprEvaluator
87838783
ArrayType::Normal, 0);
87848784

87858785
StringLiteral *SL =
8786-
StringLiteral::Create(Info.Ctx, ResultStr, StringLiteral::Ascii,
8786+
StringLiteral::Create(Info.Ctx, ResultStr, StringLiteral::Ordinary,
87878787
/*Pascal*/ false, ArrayTy, E->getLocation());
87888788

87898789
evaluateLValue(SL, Result);

clang/lib/AST/OSLog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ bool clang::analyze_os_log::computeOSLogBufferLayout(
201201
}
202202

203203
const StringLiteral *Lit = cast<StringLiteral>(StringArg->IgnoreParenCasts());
204-
assert(Lit && (Lit->isAscii() || Lit->isUTF8()));
204+
assert(Lit && (Lit->isOrdinary() || Lit->isUTF8()));
205205
StringRef Data = Lit->getString();
206206
OSLogFormatStringHandler H(VarArgs);
207207
ParsePrintfString(H, Data.begin(), Data.end(), Ctx.getLangOpts(),

clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ namespace {
601601
QualType StrType = Context->getConstantArrayType(
602602
Context->CharTy, llvm::APInt(32, Str.size() + 1), nullptr,
603603
ArrayType::Normal, 0);
604-
return StringLiteral::Create(*Context, Str, StringLiteral::Ascii,
604+
return StringLiteral::Create(*Context, Str, StringLiteral::Ordinary,
605605
/*Pascal=*/false, StrType, SourceLocation());
606606
}
607607
};

clang/lib/Frontend/Rewrite/RewriteObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ namespace {
500500
QualType StrType = Context->getConstantArrayType(
501501
Context->CharTy, llvm::APInt(32, Str.size() + 1), nullptr,
502502
ArrayType::Normal, 0);
503-
return StringLiteral::Create(*Context, Str, StringLiteral::Ascii,
503+
return StringLiteral::Create(*Context, Str, StringLiteral::Ordinary,
504504
/*Pascal=*/false, StrType, SourceLocation());
505505
}
506506
};

clang/lib/Lex/LiteralSupport.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
16811681
// If we see bad encoding for unprefixed character literals, warn and
16821682
// simply copy the byte values, for compatibility with gcc and
16831683
// older versions of clang.
1684-
bool NoErrorOnBadEncoding = isAscii();
1684+
bool NoErrorOnBadEncoding = isOrdinary();
16851685
unsigned Msg = diag::err_bad_character_encoding;
16861686
if (NoErrorOnBadEncoding)
16871687
Msg = diag::warn_bad_character_encoding;
@@ -1731,9 +1731,9 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
17311731
unsigned NumCharsSoFar = buffer_begin - &codepoint_buffer.front();
17321732

17331733
if (NumCharsSoFar > 1) {
1734-
if (isAscii() && NumCharsSoFar == 4)
1734+
if (isOrdinary() && NumCharsSoFar == 4)
17351735
PP.Diag(Loc, diag::warn_four_char_character_literal);
1736-
else if (isAscii())
1736+
else if (isOrdinary())
17371737
PP.Diag(Loc, diag::warn_multichar_character_literal);
17381738
else {
17391739
PP.Diag(Loc, diag::err_multichar_character_literal) << (isWide() ? 0 : 1);
@@ -1749,7 +1749,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
17491749
// Narrow character literals act as though their value is concatenated
17501750
// in this implementation, but warn on overflow.
17511751
bool multi_char_too_long = false;
1752-
if (isAscii() && isMultiChar()) {
1752+
if (isOrdinary() && isMultiChar()) {
17531753
LitVal = 0;
17541754
for (size_t i = 0; i < NumCharsSoFar; ++i) {
17551755
// check for enough leading zeros to shift into
@@ -1773,7 +1773,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
17731773
// if 'char' is signed for this target (C99 6.4.4.4p10). Note that multiple
17741774
// character constants are not sign extended in the this implementation:
17751775
// '\xFF\xFF' = 65536 and '\x0\xFF' = 255, which matches GCC.
1776-
if (isAscii() && NumCharsSoFar == 1 && (Value & 128) &&
1776+
if (isOrdinary() && NumCharsSoFar == 1 && (Value & 128) &&
17771777
PP.getLangOpts().CharIsSigned)
17781778
Value = (signed char)Value;
17791779
}
@@ -1878,7 +1878,7 @@ void StringLiteralParser::init(ArrayRef<Token> StringToks){
18781878
// Remember if we see any wide or utf-8/16/32 strings.
18791879
// Also check for illegal concatenations.
18801880
if (StringToks[i].isNot(Kind) && StringToks[i].isNot(tok::string_literal)) {
1881-
if (isAscii()) {
1881+
if (isOrdinary()) {
18821882
Kind = StringToks[i].getKind();
18831883
} else {
18841884
if (Diags)
@@ -2162,7 +2162,7 @@ bool StringLiteralParser::CopyStringFragment(const Token &Tok,
21622162
// If we see bad encoding for unprefixed string literals, warn and
21632163
// simply copy the byte values, for compatibility with gcc and older
21642164
// versions of clang.
2165-
bool NoErrorOnBadEncoding = isAscii();
2165+
bool NoErrorOnBadEncoding = isOrdinary();
21662166
if (NoErrorOnBadEncoding) {
21672167
memcpy(ResultPtr, Fragment.data(), Fragment.size());
21682168
ResultPtr += Fragment.size();

clang/lib/Lex/PPDirectives.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ void Preprocessor::HandleLineDirective() {
14231423
} else {
14241424
// Parse and validate the string, converting it into a unique ID.
14251425
StringLiteralParser Literal(StrTok, *this);
1426-
assert(Literal.isAscii() && "Didn't allow wide strings in");
1426+
assert(Literal.isOrdinary() && "Didn't allow wide strings in");
14271427
if (Literal.hadError) {
14281428
DiscardUntilEndOfDirective();
14291429
return;
@@ -1574,7 +1574,7 @@ void Preprocessor::HandleDigitDirective(Token &DigitTok) {
15741574
} else {
15751575
// Parse and validate the string, converting it into a unique ID.
15761576
StringLiteralParser Literal(StrTok, *this);
1577-
assert(Literal.isAscii() && "Didn't allow wide strings in");
1577+
assert(Literal.isOrdinary() && "Didn't allow wide strings in");
15781578
if (Literal.hadError) {
15791579
DiscardUntilEndOfDirective();
15801580
return;

clang/lib/Lex/Preprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ bool Preprocessor::FinishLexStringLiteral(Token &Result, std::string &String,
13531353

13541354
// Concatenate and parse the strings.
13551355
StringLiteralParser Literal(StrToks, *this);
1356-
assert(Literal.isAscii() && "Didn't allow wide strings in");
1356+
assert(Literal.isOrdinary() && "Didn't allow wide strings in");
13571357

13581358
if (Literal.hadError)
13591359
return false;

clang/lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ void Parser::ParseAvailabilityAttribute(IdentifierInfo &Availability,
12061206
// Also reject wide string literals.
12071207
if (StringLiteral *MessageStringLiteral =
12081208
cast_or_null<StringLiteral>(MessageExpr.get())) {
1209-
if (!MessageStringLiteral->isAscii()) {
1209+
if (!MessageStringLiteral->isOrdinary()) {
12101210
Diag(MessageStringLiteral->getSourceRange().getBegin(),
12111211
diag::err_expected_string_literal)
12121212
<< /*Source='availability attribute'*/ 2;

clang/lib/Parse/Parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ ExprResult Parser::ParseAsmStringLiteral(bool ForAsmLabel) {
15741574
ExprResult AsmString(ParseStringLiteralExpression());
15751575
if (!AsmString.isInvalid()) {
15761576
const auto *SL = cast<StringLiteral>(AsmString.get());
1577-
if (!SL->isAscii()) {
1577+
if (!SL->isOrdinary()) {
15781578
Diag(Tok, diag::err_asm_operand_wide_string_literal)
15791579
<< SL->isWide()
15801580
<< SL->getSourceRange();

clang/lib/Sema/SemaChecking.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static bool SemaBuiltinAnnotation(Sema &S, CallExpr *TheCall) {
161161
// Second argument should be a constant string.
162162
Expr *StrArg = TheCall->getArg(1)->IgnoreParenCasts();
163163
StringLiteral *Literal = dyn_cast<StringLiteral>(StrArg);
164-
if (!Literal || !Literal->isAscii()) {
164+
if (!Literal || !Literal->isOrdinary()) {
165165
S.Diag(StrArg->getBeginLoc(), diag::err_builtin_annotation_second_arg)
166166
<< StrArg->getSourceRange();
167167
return true;
@@ -1139,7 +1139,7 @@ void Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
11391139
if (!Format)
11401140
return;
11411141

1142-
if (!Format->isAscii() && !Format->isUTF8())
1142+
if (!Format->isOrdinary() && !Format->isUTF8())
11431143
return;
11441144

11451145
auto Diagnose = [&](unsigned ArgIndex, unsigned DestSize,
@@ -1184,7 +1184,7 @@ void Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
11841184

11851185
if (auto *Format = dyn_cast<StringLiteral>(FormatExpr)) {
11861186

1187-
if (!Format->isAscii() && !Format->isUTF8())
1187+
if (!Format->isOrdinary() && !Format->isUTF8())
11881188
return;
11891189

11901190
StringRef FormatStrRef = Format->getString();
@@ -6938,7 +6938,7 @@ bool Sema::CheckObjCString(Expr *Arg) {
69386938
Arg = Arg->IgnoreParenCasts();
69396939
StringLiteral *Literal = dyn_cast<StringLiteral>(Arg);
69406940

6941-
if (!Literal || !Literal->isAscii()) {
6941+
if (!Literal || !Literal->isOrdinary()) {
69426942
Diag(Arg->getBeginLoc(), diag::err_cfstring_literal_not_string_constant)
69436943
<< Arg->getSourceRange();
69446944
return true;
@@ -6973,7 +6973,7 @@ ExprResult Sema::CheckOSLogFormatStringArg(Expr *Arg) {
69736973
}
69746974
}
69756975

6976-
if (!Literal || (!Literal->isAscii() && !Literal->isUTF8())) {
6976+
if (!Literal || (!Literal->isOrdinary() && !Literal->isUTF8())) {
69776977
return ExprError(
69786978
Diag(Arg->getBeginLoc(), diag::err_os_log_format_not_string_constant)
69796979
<< Arg->getSourceRange());
@@ -8390,7 +8390,7 @@ class FormatStringLiteral {
83908390

83918391
QualType getType() const { return FExpr->getType(); }
83928392

8393-
bool isAscii() const { return FExpr->isAscii(); }
8393+
bool isAscii() const { return FExpr->isOrdinary(); }
83948394
bool isWide() const { return FExpr->isWide(); }
83958395
bool isUTF8() const { return FExpr->isUTF8(); }
83968396
bool isUTF16() const { return FExpr->isUTF16(); }

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ bool Sema::checkStringLiteralArgumentAttr(const AttributeCommonInfo &CI,
345345
if (ArgLocation)
346346
*ArgLocation = E->getBeginLoc();
347347

348-
if (!Literal || !Literal->isAscii()) {
348+
if (!Literal || !Literal->isOrdinary()) {
349349
Diag(E->getBeginLoc(), diag::err_attribute_argument_type)
350350
<< CI << AANT_ArgumentString;
351351
return false;
@@ -620,7 +620,7 @@ static void checkAttrArgsAreCapabilityObjs(Sema &S, Decl *D,
620620

621621
if (const auto *StrLit = dyn_cast<StringLiteral>(ArgExp)) {
622622
if (StrLit->getLength() == 0 ||
623-
(StrLit->isAscii() && StrLit->getString() == StringRef("*"))) {
623+
(StrLit->isOrdinary() && StrLit->getString() == StringRef("*"))) {
624624
// Pass empty strings to the analyzer without warnings.
625625
// Treat "*" as the universal lock.
626626
Args.push_back(ArgExp);

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16274,7 +16274,7 @@ Decl *Sema::ActOnStartLinkageSpecification(Scope *S, SourceLocation ExternLoc,
1627416274
Expr *LangStr,
1627516275
SourceLocation LBraceLoc) {
1627616276
StringLiteral *Lit = cast<StringLiteral>(LangStr);
16277-
if (!Lit->isAscii()) {
16277+
if (!Lit->isOrdinary()) {
1627816278
Diag(LangStr->getExprLoc(), diag::err_language_linkage_spec_not_ascii)
1627916279
<< LangStr->getSourceRange();
1628016280
return nullptr;
@@ -16594,7 +16594,7 @@ Decl *Sema::BuildStaticAssertDeclaration(SourceLocation StaticAssertLoc,
1659416594
llvm::raw_svector_ostream Msg(MsgBuffer);
1659516595
if (AssertMessage) {
1659616596
const auto *MsgStr = cast<StringLiteral>(AssertMessage);
16597-
if (MsgStr->isAscii())
16597+
if (MsgStr->isOrdinary())
1659816598
Msg << '"' << MsgStr->getString() << '"';
1659916599
else
1660016600
MsgStr->printPretty(Msg, nullptr, getPrintingPolicy());

clang/lib/Sema/SemaExpr.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) {
18671867
StringTokLocs.push_back(Tok.getLocation());
18681868

18691869
QualType CharTy = Context.CharTy;
1870-
StringLiteral::StringKind Kind = StringLiteral::Ascii;
1870+
StringLiteral::StringKind Kind = StringLiteral::Ordinary;
18711871
if (Literal.isWide()) {
18721872
CharTy = Context.getWideCharType();
18731873
Kind = StringLiteral::Wide;
@@ -3568,7 +3568,7 @@ ExprResult Sema::BuildPredefinedExpr(SourceLocation Loc,
35683568
ResTy = Context.getConstantArrayType(ResTy, LengthI, nullptr,
35693569
ArrayType::Normal,
35703570
/*IndexTypeQuals*/ 0);
3571-
SL = StringLiteral::Create(Context, Str, StringLiteral::Ascii,
3571+
SL = StringLiteral::Create(Context, Str, StringLiteral::Ordinary,
35723572
/*Pascal*/ false, ResTy, Loc);
35733573
}
35743574
}
@@ -3834,9 +3834,10 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
38343834
QualType StrTy = Context.getConstantArrayType(
38353835
Context.adjustStringLiteralBaseType(Context.CharTy.withConst()),
38363836
llvm::APInt(32, Length + 1), nullptr, ArrayType::Normal, 0);
3837-
Expr *Lit = StringLiteral::Create(
3838-
Context, StringRef(TokSpelling.data(), Length), StringLiteral::Ascii,
3839-
/*Pascal*/false, StrTy, &TokLoc, 1);
3837+
Expr *Lit =
3838+
StringLiteral::Create(Context, StringRef(TokSpelling.data(), Length),
3839+
StringLiteral::Ordinary,
3840+
/*Pascal*/ false, StrTy, &TokLoc, 1);
38403841
return BuildLiteralOperatorCall(R, OpNameInfo, Lit, TokLoc);
38413842
}
38423843

@@ -16753,7 +16754,7 @@ bool Sema::CheckConversionToObjCLiteral(QualType DstType, Expr *&Exp,
1675316754
if (!PT->isObjCIdType() &&
1675416755
!(ID && ID->getIdentifier()->isStr("NSString")))
1675516756
return false;
16756-
if (!SL->isAscii())
16757+
if (!SL->isOrdinary())
1675716758
return false;
1675816759

1675916760
if (Diagnose) {

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4009,7 +4009,7 @@ Sema::IsStringLiteralToNonConstPointerConversion(Expr *From, QualType ToType) {
40094009
case StringLiteral::UTF32:
40104010
// We don't allow UTF literals to be implicitly converted
40114011
break;
4012-
case StringLiteral::Ascii:
4012+
case StringLiteral::Ordinary:
40134013
return (ToPointeeType->getKind() == BuiltinType::Char_U ||
40144014
ToPointeeType->getKind() == BuiltinType::Char_S);
40154015
case StringLiteral::Wide:

0 commit comments

Comments
 (0)