Skip to content

Commit 2ce9a79

Browse files
committed
[Serialization] Use packed bits to initialize UserDefinedLiteral
UserDefinedLiteral is also a sub class of CallExpr but we forgot to initialize it in the same way as other sub classes of CallExpr.
1 parent 276a024 commit 2ce9a79

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clang/lib/Serialization/ASTReaderStmt.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3851,11 +3851,14 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
38513851
S = new (Context) BuiltinBitCastExpr(Empty);
38523852
break;
38533853

3854-
case EXPR_USER_DEFINED_LITERAL:
3855-
S = UserDefinedLiteral::CreateEmpty(
3856-
Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields],
3857-
/*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty);
3854+
case EXPR_USER_DEFINED_LITERAL: {
3855+
BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields]);
3856+
auto NumArgs = CallExprBits.getNextBits(/*Width=*/16);
3857+
auto HasFPFeatures = CallExprBits.getNextBit();
3858+
S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
3859+
Empty);
38583860
break;
3861+
}
38593862

38603863
case EXPR_CXX_STD_INITIALIZER_LIST:
38613864
S = new (Context) CXXStdInitializerListExpr(Empty);

0 commit comments

Comments
 (0)