[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:25:59 PST 2023


wheatman wrote:

This is designed to detect bugs like https://github.com/llvm/llvm-project/issues/71888 with an assert instead of silently changing the meaning of the code.

an example of the code which the assert will trigger on is 
```
#include <array>
#include <type_traits>


template <std::size_t... I>
  constexpr auto static make_helper(std::index_sequence<I...>) {
    return std::array<int, sizeof...(I)>{I...};
  }

int main(int argc, char *argv[]) {
  static constexpr auto foos = 
    make_helper(std::make_index_sequence<1UL << 16>{});
  return foos[argc];
}
```

Before this would lead to an error like 
```
<source>:8:42: error: initializer for aggregate with no elements requires explicit braces
    8 |     return std::array<int, sizeof...(I)>{I...};
```
since it thinks the pack has zero size, but finds elements in there
https://godbolt.org/z/9qYhcKKqe

afterwards it fails with the assert and backtrace like

```
clang-17: /home/wheatman/llvm-project/clang/lib/AST/ExprCXX.cpp:1684: clang::SubstNonTypeTemplateParmPackExpr::SubstNonTypeTemplateParmPackExpr(clang::QualType, clang::ExprValueKind, clang::SourceLocation, const clang::TemplateArgument &, clang::Decl *, unsigned int): Assertion `NumArguments == ArgPack.pack_size() && "number of arguments in a pack exceeded implementation limit"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/wheatman/llvm-project/build/bin/clang-17 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -main-file-name crash4.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/wheatman/llvm-project -fcoverage-compilation-dir=/home/wheatman/llvm-project -resource-dir /home/wheatman/llvm-project/build/lib/clang/18 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/backward -internal-isystem /home/wheatman/llvm-project/build/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++20 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/crash4-ef5f78.o -x c++ crash4.cpp
1.	crash4.cpp:12:56: current parser token ')'
2.	crash4.cpp:10:34: parsing function body 'main'
3.	crash4.cpp:10:34: in compound statement ('{}')
4.	crash4.cpp:6:23: instantiating function definition 'make_helper<0UL, ..., 65535UL>'
 #0 0x000055a1ae8d23ad llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/wheatman/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x000055a1ae8d289b PrintStackTraceSignalHandler(void*) /home/wheatman/llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x000055a1ae8d08c6 llvm::sys::RunSignalHandlers() /home/wheatman/llvm-project/llvm/lib/Support/Signals.cpp:105:5
 #3 0x000055a1ae8d30b5 SignalHandler(int) /home/wheatman/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007fe812eda520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x00007fe812f2e9fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x00007fe812f2e9fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x00007fe812f2e9fc pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x00007fe812eda476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x00007fe812ec07f3 abort ./stdlib/abort.c:81:7
#10 0x00007fe812ec071b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007fe812ed1e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#12 0x000055a1b4c6ec4f clang::SubstNonTypeTemplateParmPackExpr::SubstNonTypeTemplateParmPackExpr(clang::QualType, clang::ExprValueKind, clang::SourceLocation, clang::TemplateArgument const&, clang::Decl*, unsigned int) /home/wheatman/llvm-project/clang/lib/AST/ExprCXX.cpp:0:3
#13 0x000055a1b3e348db (anonymous namespace)::TemplateInstantiator::TransformTemplateParmRefExpr(clang::DeclRefExpr*, clang::NonTypeTemplateParmDecl*) /home/wheatman/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:1866:36
#14 0x000055a1b3e2378a (anonymous namespace)::TemplateInstantiator::TransformDeclRefExpr(clang::DeclRefExpr*) /home/wheatman/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:2130:14
#15 0x000055a1b3e14af6 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:1116:1
#16 0x000055a1b3e318d7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:4659:33
#17 0x000055a1b3e2ad48 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformSizeOfPackExpr(clang::SizeOfPackExpr*) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:14035:9
#18 0x000055a1b3e155ae clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:1468:1
#19 0x000055a1b3e318d7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:4659:33
#20 0x000055a1b3e30631 bool clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArguments<clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc>>(clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc>, clang::TemplateArgumentLocContainerIterator<clang::TemplateSpecializationTypeLoc>, clang::TemplateArgumentListInfo&, bool) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:4841:9
#21 0x000055a1b3e2f3bf clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:6896:7
#22 0x000055a1b3e4733a clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:6652:23
#23 0x000055a1b3e0beef clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/TypeNodes.inc:72:1
#24 0x000055a1b3e43b9f clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformElaboratedType(clang::TypeLocBuilder&, clang::ElaboratedTypeLoc) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:7011:34
#25 0x000055a1b3e0b6c5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/TypeNodes.inc:46:1
#26 0x000055a1b3e0aa2f clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:4886:34
#27 0x000055a1b3e0a5d3 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTypeWithDeducedTST(clang::TypeSourceInfo*) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:4925:5
#28 0x000055a1b3e212f2 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXUnresolvedConstructExpr(clang::CXXUnresolvedConstructExpr*) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:13727:19
#29 0x000055a1b3e1465e clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:938:1
#30 0x000055a1b3e15a1e clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformInitializer(clang::Expr*, bool) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:4104:25
#31 0x000055a1b3e5d318 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformReturnStmt(clang::ReturnStmt*) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:7917:36
#32 0x000055a1b3e130d5 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:658:1
#33 0x000055a1b3e3e8a6 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:7517:38
#34 0x000055a1b3e571f7 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*) /home/wheatman/llvm-project/clang/lib/Sema/TreeTransform.h:7499:23
#35 0x000055a1b3e11f39 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) /home/wheatman/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:74:1
#36 0x000055a1b3e11d53 clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) /home/wheatman/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4066:23
#37 0x000055a1b3ea1f21 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) /home/wheatman/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:5180:14
#38 0x000055a1b3df5414 clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool)::$_10::operator()() const /home/wheatman/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:5167:5
#39 0x000055a1b3df53d5 void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool)::$_10>(long) /home/wheatman/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:5
#40 0x000055a1ad5789f9 llvm::function_ref<void ()>::operator()() const /home/wheatman/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:5
#41 0x000055a1b2c3caad clang::runWithSufficientStackSpace(llvm::function_ref<void ()>, llvm::function_ref<void ()>) /home/wheatman/llvm-project/clang/include/clang/Basic/Stack.h:52:3
#42 0x000055a1b2c293a0 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) /home/wheatman/llvm-project/clang/lib/Sema/Sema.cpp:514:1
#43 0x000055a1b3d047c7 clang::Sema::DeduceReturnType(clang::FunctionDecl*, clang::SourceLocation, bool) /home/wheatman/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:5170:25
#44 0x000055a1b327957c clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*, llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool, bool, clang::ObjCInterfaceDecl*, bool) /home/wheatman/llvm-project/clang/lib/Sema/SemaExpr.cpp:307:9
#45 0x000055a1b39ffcba FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::OverloadingResult, bool) /home/wheatman/llvm-project/clang/lib/Sema/SemaOverload.cpp:13876:9
#46 0x000055a1b39ffab0 clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /home/wheatman/llvm-project/clang/lib/Sema/SemaOverload.cpp:13998:10
#47 0x000055a1b328024a clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /home/wheatman/llvm-project/clang/lib/Sema/SemaExpr.cpp:7263:16
#48 0x000055a1b32a079f clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) /home/wheatman/llvm-project/clang/lib/Sema/SemaExpr.cpp:7154:7
#49 0x000055a1b2b0738f clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) /home/wheatman/llvm-project/clang/lib/Parse/ParseExpr.cpp:2152:23
#50 0x000055a1b2b0e824 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) /home/wheatman/llvm-project/clang/lib/Parse/ParseExpr.cpp:1879:9
#51 0x000055a1b2b05ba9 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) /home/wheatman/llvm-project/clang/lib/Parse/ParseExpr.cpp:693:20
#52 0x000055a1b2b04098 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) /home/wheatman/llvm-project/clang/lib/Parse/ParseExpr.cpp:176:20
#53 0x000055a1b2ac7faa clang::Parser::ParseInitializer() /home/wheatman/llvm-project/clang/include/clang/Parse/Parser.h:2038:14
#54 0x000055a1b2ab0942 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /home/wheatman/llvm-project/clang/lib/Parse/ParseDecl.cpp:2604:25
#55 0x000055a1b2aaef73 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/wheatman/llvm-project/clang/lib/Parse/ParseDecl.cpp:2337:9
#56 0x000055a1b2aadf9d clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) /home/wheatman/llvm-project/clang/lib/Parse/ParseDecl.cpp:2030:10
#57 0x000055a1b2aadb59 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) /home/wheatman/llvm-project/clang/lib/Parse/ParseDecl.cpp:1954:12
#58 0x000055a1b2b94403 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) /home/wheatman/llvm-project/clang/lib/Parse/ParseStmt.cpp:247:16
#59 0x000055a1b2b93dbb clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/wheatman/llvm-project/clang/lib/Parse/ParseStmt.cpp:118:20
#60 0x000055a1b2b9ce8e clang::Parser::ParseCompoundStatementBody(bool) /home/wheatman/llvm-project/clang/lib/Parse/ParseStmt.cpp:1225:11
#61 0x000055a1b2b9e594 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /home/wheatman/llvm-project/clang/lib/Parse/ParseStmt.cpp:2503:21
#62 0x000055a1b2a89a34 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /home/wheatman/llvm-project/clang/lib/Parse/Parser.cpp:1508:3
#63 0x000055a1b2aaeb4b clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/wheatman/llvm-project/clang/lib/Parse/ParseDecl.cpp:2272:27
#64 0x000055a1b2a88821 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /home/wheatman/llvm-project/clang/lib/Parse/Parser.cpp:1236:10
#65 0x000055a1b2a87cfe clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /home/wheatman/llvm-project/clang/lib/Parse/Parser.cpp:1258:12
#66 0x000055a1b2a87579 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /home/wheatman/llvm-project/clang/lib/Parse/Parser.cpp:1062:14
#67 0x000055a1b2a853dc clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /home/wheatman/llvm-project/clang/lib/Parse/Parser.cpp:755:12
#68 0x000055a1b2a8016a clang::ParseAST(clang::Sema&, bool, bool) /home/wheatman/llvm-project/clang/lib/Parse/ParseAST.cpp:163:16
#69 0x000055a1af9848f1 clang::ASTFrontendAction::ExecuteAction() /home/wheatman/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1185:1
#70 0x000055a1af6b9c36 clang::CodeGenAction::ExecuteAction() /home/wheatman/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1155:5
#71 0x000055a1af9842ec clang::FrontendAction::Execute() /home/wheatman/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1073:7
#72 0x000055a1af89d8d8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/wheatman/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1057:23
#73 0x000055a1afb4f368 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/wheatman/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:272:8
#74 0x000055a1aacef38f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/wheatman/llvm-project/clang/tools/driver/cc1_main.cpp:294:13
#75 0x000055a1aacdee1a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /home/wheatman/llvm-project/clang/tools/driver/driver.cpp:366:5
#76 0x000055a1aacddb3c clang_main(int, char**, llvm::ToolContext const&) /home/wheatman/llvm-project/clang/tools/driver/driver.cpp:407:5
#77 0x000055a1aad14ddd main /home/wheatman/llvm-project/build/tools/clang/tools/driver/clang-driver.cpp:15:3
#78 0x00007fe812ec1d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#79 0x00007fe812ec1e40 call_init ./csu/../csu/libc-start.c:128:20
#80 0x00007fe812ec1e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#81 0x000055a1aacdd575 _start (/home/wheatman/llvm-project/build/bin/clang-17+0x1d40575)
clang++: error: unable to execute command: Aborted
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 18.0.0 (https://github.com/llvm/llvm-project.git 5fcf3bbb1acfe226572474636714ede86fffcce8)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/wheatman/llvm-project/./build/bin
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/crash4-95c748.cpp
clang++: note: diagnostic msg: /tmp/crash4-95c748.sh
clang++: note: diagnostic msg: 

********************

```
This is a bit less than ideal since it actually does print out all of the numbers in the range on this line `4.	crash4.cpp:6:23: instantiating function definition 'make_helper<0UL, ..., 65535UL>'`, but it still ensures that at least in debug mode this issue can be easily identified.

While I do think this bug should be fixed more substantially and larger packs should be suported, until then this patch will help detect these issues. 



https://github.com/llvm/llvm-project/pull/74220


More information about the cfe-commits mailing list