[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:19:04 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: None (wheatman)
<details>
<summary>Changes</summary>
…ation limit
---
Full diff: https://github.com/llvm/llvm-project/pull/74220.diff
1 Files Affected:
- (modified) clang/lib/AST/ExprCXX.cpp (+1)
``````````diff
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);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/74220
More information about the cfe-commits
mailing list