[clang] [clang] assert fail when number of arguments in pack exceed implement… (PR #74220)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 2 19:18:37 PST 2023
https://github.com/wheatman created https://github.com/llvm/llvm-project/pull/74220
…ation limit
>From 8990877d381639d8498630fd4e9b30732ab893d6 Mon Sep 17 00:00:00 2001
From: Brian Wheatman <bwheatman at gmail.com>
Date: Sat, 2 Dec 2023 22:17:24 -0500
Subject: [PATCH] [clang] assert fail when number of arguments in pack exceed
implementation limit
---
clang/lib/AST/ExprCXX.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index 83af7998f6833..5798321ea59f3 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -1681,6 +1681,7 @@ SubstNonTypeTemplateParmPackExpr::SubstNonTypeTemplateParmPackExpr(
AssociatedDecl(AssociatedDecl), Arguments(ArgPack.pack_begin()),
NumArguments(ArgPack.pack_size()), Index(Index), NameLoc(NameLoc) {
assert(AssociatedDecl != nullptr);
+ assert(NumArguments == ArgPack.pack_size() && "number of arguments in a pack exceeded implementation limit");
setDependence(ExprDependence::TypeValueInstantiation |
ExprDependence::UnexpandedPack);
}
More information about the cfe-commits
mailing list