llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.96k stars 11.94k forks source link

clang crashes in clang/lib/AST/ExprConstant.cpp:14737 Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed #49570

Open haoxintu opened 3 years ago

haoxintu commented 3 years ago
Bugzilla Link 50226
Version trunk
OS Linux
CC @chengniansun,@zygoloid

Extended Description

Hi all.

The small program emits one error then crashes. This crash only occurs in the current trunk of clang, so I guess clang should be more friendly and exit normally in this case?

$cat small.c

#include <emmintrin.h>
#include <stdint.h>
int8_t c_7;
void foo() {
  __m128i b;
  b != ((c_7 = b? : 2) ?: 0);
}
$clang small.c
small.c:6:17: error: used type '__m128i' (vector of 2 'long long' values) where arithmetic or pointer type is required
  b != ((c_7 = b? : 2) ?: 0);
               ~^
clang-13: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/clang/lib/AST/ExprConstant.cpp:14737: bool clang::Expr::EvaluateAsInt(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::SideEffectsKind, bool) const: Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -main-file-name small.c -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/haoxin/haoxin-data/dut-research/CovSmith/front-end-bugs -resource-dir /media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/lib/clang/13.0.0 -c-isystem /usr/local/include/csmith-2.3.0/ -internal-isystem /media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/home/haoxin/haoxin-data/dut-research/CovSmith/front-end-bugs -ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/small-5b6db7.o -x c small.c
1.  small.c:6:29: current parser token ';'
2.  small.c:4:12: parsing function body 'foo'
3.  small.c:4:12: in compound statement ('{}')
 #&#8203;0 0x000055c1d9c2981c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x363681c)
 #&#8203;1 0x000055c1d9c276d4 llvm::sys::RunSignalHandlers() (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x36346d4)
 #&#8203;2 0x000055c1d9c27843 SignalHandler(int) Signals.cpp:0:0
 #&#8203;3 0x00007fe5024ce980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #&#8203;4 0x00007fe50117ffb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #&#8203;5 0x00007fe501181921 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:81:0
 #&#8203;6 0x00007fe50117148a __assert_fail_base /build/glibc-S9d2JN/glibc-2.27/assert/assert.c:89:0
 #&#8203;7 0x00007fe501171502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
 #&#8203;8 0x000055c1dc34b72a clang::Expr::EvaluateAsInt(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::SideEffectsKind, bool) const (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x5d5872a)
 #&#8203;9 0x000055c1d77996fc tryGCCVectorConvertAndSplat(clang::Sema&, clang::ActionResult<clang::Expr*, true>*, clang::ActionResult<clang::Expr*, true>*) SemaExpr.cpp:0:0
#&#8203;10 0x000055c1dbaaa84e clang::Sema::CheckVectorOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, bool, bool, bool) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54b784e)
#&#8203;11 0x000055c1dbaaae8b clang::Sema::CheckVectorCompareOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::BinaryOperatorKind) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54b7e8b)
#&#8203;12 0x000055c1dbab341c clang::Sema::CheckCompareOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::BinaryOperatorKind) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c041c)
#&#8203;13 0x000055c1dbab5bf8 clang::Sema::CreateBuiltinBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c2bf8)
#&#8203;14 0x000055c1dbab6f5c clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c3f5c)
#&#8203;15 0x000055c1dbab7419 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x54c4419)
#&#8203;16 0x000055c1db7467e3 clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51537e3)
#&#8203;17 0x000055c1db747e29 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x5154e29)
#&#8203;18 0x000055c1db79dafd clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51aaafd)
#&#8203;19 0x000055c1db79a894 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributesWithRange&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51a7894)
#&#8203;20 0x000055c1db79ab4c clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51a7b4c)
#&#8203;21 0x000055c1db797f81 clang::Parser::ParseCompoundStatementBody(bool) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51a4f81)
#&#8203;22 0x000055c1db7a041b clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51ad41b)
#&#8203;23 0x000055c1db7050b4 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x51120b4)
#&#8203;24 0x000055c1db72694e clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x513394e)
#&#8203;25 0x000055c1db701229 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x510e229)
#&#8203;26 0x000055c1db701981 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.240) Parser.cpp:0:0
#&#8203;27 0x000055c1db701b70 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x510eb70)
#&#8203;28 0x000055c1db7027b9 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x510f7b9)
#&#8203;29 0x000055c1db6f8d49 clang::ParseAST(clang::Sema&, bool, bool) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x5105d49)
#&#8203;30 0x000055c1dab839a8 clang::CodeGenAction::ExecuteAction() (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x45909a8)
#&#8203;31 0x000055c1da50beb1 clang::FrontendAction::Execute() (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x3f18eb1)
#&#8203;32 0x000055c1da4a8ff2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x3eb5ff2)
#&#8203;33 0x000055c1da5d6b8a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x3fe3b8a)
#&#8203;34 0x000055c1d78cbc9c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x12d8c9c)
#&#8203;35 0x000055c1d78c6f99 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#&#8203;36 0x000055c1d77edf87 main (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x11faf87)
#&#8203;37 0x00007fe501162bf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#&#8203;38 0x000055c1d78c6b0a _start (/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin/clang-13+0x12d3b0a)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project e5984a3680bef22d422beaafa73bf131d7197973)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin
clang-13: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/small-84b262.c
clang-13: note: diagnostic msg: /tmp/small-84b262.sh
clang-13: note: diagnostic msg: 

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

$clang -v
clang version 13.0.0 (https://github.com/llvm/llvm-project e5984a3680bef22d422beaafa73bf131d7197973)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/dut-research/compilers/llvm-project/build-20210502/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

Thanks, Haoxin

chengniansun commented 3 years ago

A possible duplicate.

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git ef906573a127cffef7cae75d5155c15a8a2a3a5e)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ cat mutant.c
main() {
  unsigned a unsigned b;
  __atomic_fetch_xor(&a, b, sizeof x);
}
$ clang-trunk  mutant.c
mutant.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main() {
^
mutant.c:2:13: error: expected ';' at end of declaration
  unsigned a unsigned b;
            ^
            ;
clang-13: /tmp/tmp.B1HwadcXIH-clang-builder/llvm-project/clang/lib/AST/ExprConstant.cpp:15525: llvm::Optional<llvm::APSInt> clang::Expr::getIntegerConstantExpr(const clang::ASTContext&, clang::SourceLocation*, bool) const: Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /scratch/software/clang-trunk/bin/clang-13 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -main-file-name mutant.c -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210625_140252_1028/delta/perses_result -resource-dir /scratch/software/clang-trunk/lib/clang/13.0.0 -c-isystem . -c-isystem /usr/local/include/cmsith -internal-isystem /scratch/software/clang-trunk/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210625_140252_1028/delta/perses_result -ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/mutant-76d37d.o -x c mutant.c
1.  mutant.c:3:37: current parser token ')'
2.  mutant.c:1:8: parsing function body 'main'
3.  mutant.c:1:8: in compound statement ('{}')
 #&#8203;0 0x000055860b5931f4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #&#8203;1 0x000055860b5909ae SignalHandler(int) Signals.cpp:0:0
 #&#8203;2 0x00007f0e065d93c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #&#8203;3 0x00007f0e0607818b raise /build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #&#8203;4 0x00007f0e06057859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #&#8203;5 0x00007f0e06057729 get_sysdep_segment_value /build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #&#8203;6 0x00007f0e06057729 _nl_load_domain /build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #&#8203;7 0x00007f0e06068f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #&#8203;8 0x000055860e698391 clang::Expr::getIntegerConstantExpr(clang::ASTContext const&, clang::SourceLocation*, bool) const (/scratch/software/clang-trunk/bin/clang-13+0x6a5e391)
 #&#8203;9 0x000055860d9483d3 clang::Sema::BuildAtomicExpr(clang::SourceRange, clang::SourceRange, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::AtomicExpr::AtomicOp, clang::Sema::AtomicArgumentOrder) (/scratch/software/clang-trunk/bin/clang-13+0x5d0e3d3)
#&#8203;10 0x000055860d9487c0 clang::Sema::SemaAtomicOpsOverloaded(clang::ActionResult<clang::Expr*, true>, clang::AtomicExpr::AtomicOp) (/scratch/software/clang-trunk/bin/clang-13+0x5d0e7c0)
#&#8203;11 0x000055860d97c45b clang::Sema::CheckBuiltinFunctionCall(clang::FunctionDecl*, unsigned int, clang::CallExpr*) (/scratch/software/clang-trunk/bin/clang-13+0x5d4245b)
#&#8203;12 0x000055860dc549c7 clang::Sema::BuildResolvedCallExpr(clang::Expr*, clang::NamedDecl*, clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, clang::CallExpr::ADLCallKind) (/scratch/software/clang-trunk/bin/clang-13+0x601a9c7)
#&#8203;13 0x000055860dc5597b clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/scratch/software/clang-trunk/bin/clang-13+0x601b97b)
#&#8203;14 0x000055860dc56d3d clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/scratch/software/clang-trunk/bin/clang-13+0x601cd3d)
#&#8203;15 0x000055860d80a7cb clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) (/scratch/software/clang-trunk/bin/clang-13+0x5bd07cb)
#&#8203;16 0x000055860d8038d2 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/scratch/software/clang-trunk/bin/clang-13+0x5bc98d2)
#&#8203;17 0x000055860d8063cb clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/scratch/software/clang-trunk/bin/clang-13+0x5bcc3cb)
#&#8203;18 0x000055860d80646d clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/scratch/software/clang-trunk/bin/clang-13+0x5bcc46d)
#&#8203;19 0x000055860d8099cd clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/scratch/software/clang-trunk/bin/clang-13+0x5bcf9cd)
#&#8203;20 0x000055860d87160e clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/scratch/software/clang-trunk/bin/clang-13+0x5c3760e)
#&#8203;21 0x000055860d868ba2 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributesWithRange&) (/scratch/software/clang-trunk/bin/clang-13+0x5c2eba2)
#&#8203;22 0x000055860d86958a clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/scratch/software/clang-trunk/bin/clang-13+0x5c2f58a)
#&#8203;23 0x000055860d86a509 clang::Parser::ParseCompoundStatementBody(bool) (/scratch/software/clang-trunk/bin/clang-13+0x5c30509)
#&#8203;24 0x000055860d86cb1a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/scratch/software/clang-trunk/bin/clang-13+0x5c32b1a)
#&#8203;25 0x000055860d7b2db2 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/scratch/software/clang-trunk/bin/clang-13+0x5b78db2)
#&#8203;26 0x000055860d7df710 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/scratch/software/clang-trunk/bin/clang-13+0x5ba5710)
#&#8203;27 0x000055860d7ad5b6 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/scratch/software/clang-trunk/bin/clang-13+0x5b735b6)
#&#8203;28 0x000055860d7adba1 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#&#8203;29 0x000055860d7b43a7 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/scratch/software/clang-trunk/bin/clang-13+0x5b7a3a7)
#&#8203;30 0x000055860d7b593e clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/scratch/software/clang-trunk/bin/clang-13+0x5b7b93e)
#&#8203;31 0x000055860d7b5ce9 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/scratch/software/clang-trunk/bin/clang-13+0x5b7bce9)
#&#8203;32 0x000055860d7a815a clang::ParseAST(clang::Sema&, bool, bool) (/scratch/software/clang-trunk/bin/clang-13+0x5b6e15a)
#&#8203;33 0x000055860c6ef458 clang::CodeGenAction::ExecuteAction() (/scratch/software/clang-trunk/bin/clang-13+0x4ab5458)
#&#8203;34 0x000055860bf9e9e9 clang::FrontendAction::Execute() (/scratch/software/clang-trunk/bin/clang-13+0x43649e9)
#&#8203;35 0x000055860bf31c36 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/scratch/software/clang-trunk/bin/clang-13+0x42f7c36)
#&#8203;36 0x000055860c07c870 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/scratch/software/clang-trunk/bin/clang-13+0x4442870)
#&#8203;37 0x0000558608e9c696 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/scratch/software/clang-trunk/bin/clang-13+0x1262696)
#&#8203;38 0x0000558608e989d8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#&#8203;39 0x0000558608dc60e6 main (/scratch/software/clang-trunk/bin/clang-13+0x118c0e6)
#&#8203;40 0x00007f0e060590b3 __libc_start_main /build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#&#8203;41 0x0000558608e9854e _start (/scratch/software/clang-trunk/bin/clang-13+0x125e54e)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git ef906573a127cffef7cae75d5155c15a8a2a3a5e)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/mutant-2d6fad.c
clang-13: note: diagnostic msg: /tmp/mutant-2d6fad.sh
clang-13: note: diagnostic msg:

********************
fhahn commented 2 years ago

Still crashes on current main: https://clang.godbolt.org/z/4MrTco1q1

danakj commented 1 year ago

I am running into this crash in Clang 17 when working with std::byte.

0.  Program arguments: /Users/danakj/s/llvm/install/bin/clang++ -I/Users/danakj/s/subspace -I/Users/danakj/s/subspace/third_party/googletest -I/Users/danakj/s/subspace/third_party/fmt/include -isystem /Users/danakj/s/subspace/third_party/googletest/googletest/include -isystem /Users/danakj/s/subspace/third_party/googletest/googletest -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include/c++/v1 -isystem /Users/danakj/s/llvm/install-17/lib/clang/17/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include -O3 -DNDEBUG -std=gnu++20 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk -mmacosx-version-min=13.4 -fno-rtti -Wno-nullability-completeness -Werror -MD -MT sus/CMakeFiles/subspace_unittests.dir/num/transmogrify_unittest.cc.o -MF sus/CMakeFiles/subspace_unittests.dir/num/transmogrify_unittest.cc.o.d -o sus/CMakeFiles/subspace_unittests.dir/num/transmogrify_unittest.cc.o -c /Users/danakj/s/subspace/sus/num/transmogrify_unittest.cc
1.  /Users/danakj/s/subspace/sus/num/transmogrify_unittest.cc:620:40: current parser token ')'
2.  /Users/danakj/s/subspace/sus/num/transmogrify_unittest.cc:20:1: parsing namespace '(anonymous)'
3.  /Users/danakj/s/subspace/sus/num/transmogrify_unittest.cc:619:32: parsing function body '(anonymous namespace)::NumTransmogrify_stdbyte_Test::TestBody'
4.  /Users/danakj/s/subspace/sus/num/transmogrify_unittest.cc:619:32: in compound statement ('{}')
  #0 0x00000001068341d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10214c1d8)
  #1 0x0000000106832784 llvm::sys::RunSignalHandlers() (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10214a784)
  #2 0x00000001068339d0 llvm::sys::CleanupOnSignal(unsigned long) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10214b9d0)
  #3 0x000000010679b828 CrashRecoverySignalHandler(int) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1020b3828)
  #4 0x00000001a86dea24 (/usr/lib/system/libsystem_platform.dylib+0x18042ea24)
  #5 0x00000001a86afc28 (/usr/lib/system/libsystem_pthread.dylib+0x1803ffc28)
  #6 0x00000001a85bdae8 (/usr/lib/system/libsystem_c.dylib+0x18030dae8)
  #7 0x00000001a85bce44 (/usr/lib/system/libsystem_c.dylib+0x18030ce44)
  #8 0x000000010a61a648 FastEvaluateAsRValue(clang::Expr const*, clang::Expr::EvalResult&, clang::ASTContext const&, bool&) (.cold.1) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x105f32648)
  #9 0x0000000108d24b44 clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10463cb44)
 #10 0x00000001083000ec clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c180ec)
 #11 0x0000000108300014 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18014)
 #12 0x00000001082fb5ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c135ec)
 #13 0x00000001082fb36c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c1336c)
 #14 0x00000001087e8e50 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104100e50)
 #15 0x0000000108901b34 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104219b34)
 #16 0x00000001088f90f0 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042110f0)
 #17 0x0000000108300d98 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7::operator()(clang::Expr const*) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18d98)
 #18 0x00000001083005c8 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c185c8)
 #19 0x00000001082fffd8 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c17fd8)
 #20 0x00000001082fb5ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c135ec)
 #21 0x00000001082fb36c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c1336c)
 #22 0x00000001087e8e50 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104100e50)
 #23 0x0000000108901b34 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104219b34)
 #24 0x00000001088f90f0 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042110f0)
 #25 0x0000000108300d98 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7::operator()(clang::Expr const*) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18d98)
 #26 0x0000000108300080 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18080)
 #27 0x00000001082fb5ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c135ec)
 #28 0x00000001082fb36c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c1336c)
 #29 0x00000001088ea52c std::__1::enable_if<IsPartialSpecialization<clang::ClassTemplatePartialSpecializationDecl>::value, clang::Sema::TemplateDeductionResult>::type FinishTemplateArgumentDeduction<clang::ClassTemplatePartialSpecializationDecl>(clang::Sema&, clang::ClassTemplatePartialSpecializationDecl*, bool, clang::TemplateArgumentList const&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, clang::sema::TemplateDeductionInfo&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10420252c)
 #30 0x00000001088e9a14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceTemplateArguments(clang::ClassTemplatePartialSpecializationDecl*, clang::TemplateArgumentList const&, clang::sema::TemplateDeductionInfo&)::$_0>(long) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104201a14)
 #31 0x00000001081de594 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103af6594)
 #32 0x00000001088934e4 clang::Sema::DeduceTemplateArguments(clang::ClassTemplatePartialSpecializationDecl*, clang::TemplateArgumentList const&, clang::sema::TemplateDeductionInfo&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1041ab4e4)
 #33 0x00000001088f6f74 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10420ef74)
 #34 0x00000001089aa1b4 void llvm::function_ref<void ()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_3>(long) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042c21b4)
 #35 0x00000001081de594 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103af6594)
 #36 0x0000000108999680 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042b1680)
 #37 0x0000000108998f64 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042b0f64)
 #38 0x0000000108256330 clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&, clang::DeclContext*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103b6e330)
 #39 0x000000010849c8ec clang::Sema::BuildQualifiedDeclarationNameExpr(clang::CXXScopeSpec&, clang::DeclarationNameInfo const&, bool, clang::Scope const*, clang::TypeSourceInfo**) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103db48ec)
 #40 0x000000010890bfb8 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformDependentScopeDeclRefExpr(clang::DependentScopeDeclRefExpr*, bool, clang::TypeSourceInfo**) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104223fb8)
 #41 0x00000001089007d0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042187d0)
 #42 0x000000010890f36c clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformRequiresExpr(clang::RequiresExpr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10422736c)
 #43 0x0000000108907564 (anonymous namespace)::TemplateInstantiator::TransformRequiresExpr(clang::RequiresExpr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10421f564)
 #44 0x00000001088f90f0 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042110f0)
 #45 0x0000000108300d98 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7::operator()(clang::Expr const*) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18d98)
 #46 0x0000000108300080 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18080)
 #47 0x00000001082fb5ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c135ec)
 #48 0x00000001082fb36c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c1336c)
 #49 0x00000001087e8e50 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104100e50)
 #50 0x0000000108901b34 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104219b34)
 #51 0x00000001088f90f0 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1042110f0)
 #52 0x0000000108300d98 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7::operator()(clang::Expr const*) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18d98)
 #53 0x0000000108300080 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c18080)
 #54 0x00000001082fb5ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c135ec)
 #55 0x00000001082fb36c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c1336c)
 #56 0x00000001082fd8e8 clang::Sema::CheckInstantiatedFunctionTemplateConstraints(clang::SourceLocation, clang::FunctionDecl*, llvm::ArrayRef<clang::TemplateArgument>, clang::ConstraintSatisfaction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103c158e8)
 #57 0x0000000108894d98 clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool, llvm::function_ref<bool ()>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1041acd98)
 #58 0x00000001088ecaac void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)::$_4>(long) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104204aac)
 #59 0x00000001081de594 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103af6594)
 #60 0x0000000108896108 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, bool, llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1041ae108)
 #61 0x0000000108772d38 clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool, clang::CallExpr::ADLCallKind, clang::OverloadCandidateParamOrder, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10408ad38)
 #62 0x000000010877fb80 AddOverloadedCallCandidate(clang::Sema&, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104097b80)
 #63 0x000000010877fa38 clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104097a38)
 #64 0x000000010877fe28 clang::Sema::buildOverloadedCallSet(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::OverloadCandidateSet*, clang::ActionResult<clang::Expr*, true>*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x104097e28)
 #65 0x000000010878010c clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10409810c)
 #66 0x0000000108495fa0 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103dadfa0)
 #67 0x00000001084abe84 clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103dc3e84)
 #68 0x00000001080d4104 clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039ec104)
 #69 0x00000001080d5108 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039ed108)
 #70 0x00000001080d7880 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039ef880)
 #71 0x00000001080d1bd0 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039e9bd0)
 #72 0x00000001080a6078 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039be078)
 #73 0x00000001080a3d28 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039bbd28)
 #74 0x00000001080a322c clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039bb22c)
 #75 0x00000001080a2e18 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039bae18)
 #76 0x000000010812be98 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a43e98)
 #77 0x000000010812a4cc clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a424cc)
 #78 0x00000001081323b8 clang::Parser::ParseCompoundStatementBody(bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a4a3b8)
 #79 0x0000000108133250 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a4b250)
 #80 0x000000010814b864 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a63864)
 #81 0x00000001080a457c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039bc57c)
 #82 0x000000010814abc0 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a62bc0)
 #83 0x000000010814a548 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a62548)
 #84 0x00000001081497b0 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a617b0)
 #85 0x00000001080bd648 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039d5648)
 #86 0x00000001080bcec0 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039d4ec0)
 #87 0x00000001080a2c40 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039bac40)
 #88 0x0000000108149380 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a61380)
 #89 0x0000000108147b18 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x103a5fb18)
 #90 0x000000010809259c clang::ParseAST(clang::Sema&, bool, bool) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1039aa59c)
 #91 0x00000001071c9638 clang::FrontendAction::Execute() (/Users/danakj/s/llvm/install-17/bin/clang-16+0x102ae1638)
 #92 0x0000000107164af4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x102a7caf4)
 #93 0x00000001072455d4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x102b5d5d4)
 #94 0x00000001046f05b0 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1000085b0)
 #95 0x00000001046ee224 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x100006224)
 #96 0x0000000106fddc10 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_1>(long) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1028f5c10)
 #97 0x000000010679b548 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1020b3548)
 #98 0x0000000106fdd5e8 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1028f55e8)
 #99 0x0000000106fae450 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1028c6450)
#100 0x0000000106fae680 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1028c6680)
#101 0x0000000106fc5a48 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x1028dda48)
#102 0x00000001046ed60c clang_main(int, char**, llvm::ToolContext const&) (/Users/danakj/s/llvm/install-17/bin/clang-16+0x10000560c)
#103 0x00000001046f8c30 main (/Users/danakj/s/llvm/install-17/bin/clang-16+0x100010c30)
#104 0x00000001a8357f28
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 78be5aebaaf068e2a1496ff885eb1281c3fafb6a)
Target: arm64-apple-darwin22.5.0
Thread model: posix
InstalledDir: /Users/danakj/s/llvm/install/bin
danakj commented 1 year ago

Here's a minimal repro that triggers this assert without __m128i involved. Just running clang with -std=c++20:

#include <concepts>
#include <stdint.h>
#include <cstddef>

template <class T>
concept EnumClass =
    !requires(T t) {
      {
        [](std::underlying_type_t<T>) {}(t)
      };
    };

template <class To, class From>
struct TransmogrifyImpl;

template <class T, EnumClass F>
struct TransmogrifyImpl<T, F>
{
  constexpr static T mog_from(const F &from) noexcept
  {
    return static_cast<std::underlying_type_t<F>>(from);
  }
};

int main()
{
  return TransmogrifyImpl<uint32_t, std::byte>::mog_from(std::byte{0xff});
}
✗ /Users/danakj/s/llvm/install/bin/clang++ -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include/c++/v1 -isystem /Users/danakj/s/llvm/install-17/lib/clang/17/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include -std=c++20 -c /var/folders/nh/9_s29lyn4wv0z_3gp5plrsvr0000gn/T/transmogrify_unittest-1c3c9e.cpp
Assertion failed: (!isValueDependent() && "Expression evaluator can't be called on a dependent expression."), function EvaluateAsConstantExpr, file ExprConstant.cpp, line 15392.
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: /Users/danakj/s/llvm/install/bin/clang++ -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include/c++/v1 -isystem /Users/danakj/s/llvm/install-17/lib/clang/17/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include -std=c++20 -c /var/folders/nh/9_s29lyn4wv0z_3gp5plrsvr0000gn/T/transmogrify_unittest-1c3c9e.cpp
1.  /var/folders/nh/9_s29lyn4wv0z_3gp5plrsvr0000gn/T/transmogrify_unittest-1c3c9e.cpp:27:49: current parser token 'mog_from'
2.  /var/folders/nh/9_s29lyn4wv0z_3gp5plrsvr0000gn/T/transmogrify_unittest-1c3c9e.cpp:26:1: parsing function body 'main'
3.  /var/folders/nh/9_s29lyn4wv0z_3gp5plrsvr0000gn/T/transmogrify_unittest-1c3c9e.cpp:26:1: in compound statement ('{}')
^CStack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  clang-16                 0x00000001042c01d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  clang-16                 0x00000001042be784 llvm::sys::RunSignalHandlers() + 112
2  clang-16                 0x00000001042bf9d0 llvm::sys::CleanupOnSignal(unsigned long) + 236
3  clang-16                 0x0000000104227828 CrashRecoverySignalHandler(int) + 156
4  libsystem_platform.dylib 0x00000001a86dea24 _sigtramp + 56
5  libsystem_pthread.dylib  0x00000001a86afc28 pthread_kill + 288
6  libsystem_c.dylib        0x00000001a85bdae8 abort + 180
7  libsystem_c.dylib        0x00000001a85bce44 err + 0
8  clang-16                 0x00000001080a6648 FastEvaluateAsRValue(clang::Expr const*, clang::Expr::EvalResult&, clang::ASTContext const&, bool&) (.cold.1) + 0
9  clang-16                 0x00000001067b0b44 clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const + 1080
10 clang-16                 0x0000000105d8c0ec clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) + 400
11 clang-16                 0x0000000105d875ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) + 276
12 clang-16                 0x0000000105d8736c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) + 584
13 clang-16                 0x0000000106274e50 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) + 524
14 clang-16                 0x000000010638db34 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) + 196
15 clang-16                 0x00000001063850f0 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) + 60
16 clang-16                 0x0000000105d8cd98 calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7::operator()(clang::Expr const*) const + 756
17 clang-16                 0x0000000105d8c080 clang::ActionResult<clang::Expr*, true> calculateConstraintSatisfaction<calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7>(clang::Sema&, clang::Expr const*, clang::ConstraintSatisfaction&, calculateConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, clang::SourceLocation, clang::MultiLevelTemplateArgumentList const&, clang::Expr const*, clang::ConstraintSatisfaction&)::$_7&&) + 292
18 clang-16                 0x0000000105d875ec CheckConstraintSatisfaction(clang::Sema&, clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) + 276
19 clang-16                 0x0000000105d8736c clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) + 584
20 clang-16                 0x000000010637652c std::__1::enable_if<IsPartialSpecialization<clang::ClassTemplatePartialSpecializationDecl>::value, clang::Sema::TemplateDeductionResult>::type FinishTemplateArgumentDeduction<clang::ClassTemplatePartialSpecializationDecl>(clang::Sema&, clang::ClassTemplatePartialSpecializationDecl*, bool, clang::TemplateArgumentList const&, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, clang::sema::TemplateDeductionInfo&) + 2820
21 clang-16                 0x0000000106375a14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::DeduceTemplateArguments(clang::ClassTemplatePartialSpecializationDecl*, clang::TemplateArgumentList const&, clang::sema::TemplateDeductionInfo&)::$_0>(long) + 40
22 clang-16                 0x0000000105c6a594 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 52
23 clang-16                 0x000000010631f4e4 clang::Sema::DeduceTemplateArguments(clang::ClassTemplatePartialSpecializationDecl*, clang::TemplateArgumentList const&, clang::sema::TemplateDeductionInfo&) + 608
24 clang-16                 0x0000000106382f74 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) + 636
25 clang-16                 0x00000001064361b4 void llvm::function_ref<void ()>::callback_fn<clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*)::$_3>(long) + 56
26 clang-16                 0x0000000105c6a594 clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 52
27 clang-16                 0x0000000106425680 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) + 1572
28 clang-16                 0x0000000106424f64 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) + 32
29 clang-16                 0x0000000105ce2330 clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&, clang::DeclContext*) + 220
30 clang-16                 0x0000000105dccf14 clang::Sema::getTypeName(clang::IdentifierInfo const&, clang::SourceLocation, clang::Scope*, clang::CXXScopeSpec*, bool, bool, clang::OpaquePtr<clang::QualType>, bool, bool, bool, clang::ImplicitTypenameContext, clang::IdentifierInfo**) + 220
31 clang-16                 0x0000000105bd96ac clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(clang::CXXScopeSpec&, bool, clang::ImplicitTypenameContext) + 264
32 clang-16                 0x0000000105bd9fe0 clang::Parser::TryAnnotateTypeOrScopeToken(clang::ImplicitTypenameContext) + 220
33 clang-16                 0x0000000105b63838 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) + 10236
34 clang-16                 0x0000000105b5dbd0 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 236
35 clang-16                 0x0000000105b5dacc clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 20
36 clang-16                 0x0000000105bbc6f4 clang::Parser::ParseReturnStatement() + 280
37 clang-16                 0x0000000105bb708c clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) + 2484
38 clang-16                 0x0000000105bb64cc clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) + 300
39 clang-16                 0x0000000105bbe3b8 clang::Parser::ParseCompoundStatementBody(bool) + 1508
40 clang-16                 0x0000000105bbf250 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 180
41 clang-16                 0x0000000105bd7864 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) + 2608
42 clang-16                 0x0000000105b3057c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 3156
43 clang-16                 0x0000000105bd6bc0 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 1032
44 clang-16                 0x0000000105bd6548 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 380
45 clang-16                 0x0000000105bd57b0 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) + 1580
46 clang-16                 0x0000000105bd3b18 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) + 1492
47 clang-16                 0x0000000105b1e59c clang::ParseAST(clang::Sema&, bool, bool) + 612
48 clang-16                 0x0000000104c55638 clang::FrontendAction::Execute() + 100
49 clang-16                 0x0000000104bf0af4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 796
50 clang-16                 0x0000000104cd15d4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 552
51 clang-16                 0x000000010217c5b0 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2044
52 clang-16                 0x000000010217a224 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) + 940
53 clang-16                 0x0000000104a69c10 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_1>(long) + 32
54 clang-16                 0x0000000104227548 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 164
55 clang-16                 0x0000000104a695e8 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const + 228
56 clang-16                 0x0000000104a3a450 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 804
57 clang-16                 0x0000000104a3a680 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const + 120
58 clang-16                 0x0000000104a51a48 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) + 340
59 clang-16                 0x000000010217960c clang_main(int, char**, llvm::ToolContext const&) + 9404
60 clang-16                 0x0000000102184c30 main + 32
61 dyld                     0x00000001a8357f28 start + 2236
danakj commented 1 year ago

I think it's caused in this case by putting a concept in a partial specialization.

shafik commented 1 year ago

Assertion:

clang: /root/llvm-project/clang/lib/AST/ExprConstant.cpp:15370:
bool clang::Expr::EvaluateAsInt(clang::Expr::EvalResult&, const clang::ASTContext&, clang::Expr::SideEffectsKind, bool) const: 
Assertion `!isValueDependent() && "Expression evaluator can't be called on a dependent expression."' failed.
shafik commented 7 months ago

The reduced version no longer crashes on trunk but the original does.