Summary of when it works (:heavy_check_mark:), and when it does not (:red_circle:).
+ docker run --rm -it --device=/dev/kfd --device=/dev/dri rocm/dev-ubuntu-22.04-gcc-12:5.7 bash -c 'cd /testing && hipcc --version && hipcc -DENABLE_BUG -std=c++20 test.cpp'
HIP version: 5.7.31921-d1770ee1b
AMD clang version 17.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-5.7.0 23352 d1e13c532a947d0cbfc94759c00dcf152294aa13)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rocm-5.7.0/llvm/bin
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: /opt/rocm-5.7.0/llvm/bin/clang-17 -cc1 -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fno-rounding-math -mconstructor-aliases -aux-target-cpu x86-64 -fcuda-is-device -mllvm -amdgpu-internalize-symbols -fcuda-allow-variadic-functions -fvisibility=hidden -fapply-global-visibility-to-externs -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/hip.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/ocml.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/ockl.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_daz_opt_off.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_unsafe_math_off.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_finite_only_off.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_wavefrontsize64_on.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_isa_version_906.bc -mlink-builtin-bitcode /opt/rocm-5.7.0/amdgcn/bitcode/oclc_abi_version_500.bc -target-cpu gfx906 -debugger-tuning=gdb -resource-dir /opt/rocm-5.7.0/llvm/lib/clang/17.0.0 -internal-isystem /opt/rocm-5.7.0/llvm/lib/clang/17.0.0/include/cuda_wrappers -idirafter /opt/rocm-5.7.0/include -include __clang_hip_runtime_wrapper.h -c-isystem /opt/rocm-5.7.0/llvm/include/gpu-none-llvm -isystem /opt/rocm-5.7.0/include -D ENABLE_BUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/backward -internal-isystem /opt/rocm-5.7.0/llvm/lib/clang/17.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /opt/rocm-5.7.0/llvm/lib/clang/17.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -std=c++20 -fdeprecated-macro -fno-autolink -fdebug-compilation-dir=/testing -ferror-limit 19 -fhip-new-launch-api -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -cuid=44554cf282633cd2 -fcuda-allow-variadic-functions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/test-gfx906-84beef.o -x hip test.cpp
1. /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ranges:991:2: current parser token '{'
2. /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ranges:56:1: parsing namespace 'std'
3. /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ranges:59:1: parsing namespace 'std::ranges'
4. /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ranges:846:1: parsing namespace 'std::ranges::views'
5. /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/ranges:972:5: parsing struct/union/class body 'std::ranges::views::__adaptor::_Partial<_Adaptor, _Arg>'
#0 0x000056170b573576 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x254f576)
#1 0x000056170b570e74 SignalHandler(int) Signals.cpp:0:0
#2 0x00007faec49bc520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000056170e0a22e8 clang::ASTContext::getSubstTemplateTypeParmType(clang::QualType, clang::Decl*, unsigned int, std::optional<unsigned int>) const (/opt/rocm-5.7.0/llvm/bin/clang-17+0x507e2e8)
#4 0x000056170de26cfb (anonymous namespace)::TemplateInstantiator::BuildSubstTemplateTypeParmType(clang::TypeLocBuilder&, bool, bool, clang::Decl*, unsigned int, std::optional<unsigned int>, clang::TemplateArgument, clang::SourceLocation) (.isra.0) SemaTemplateInstantiate.cpp:0:0
#5 0x000056170de288d9 (anonymous namespace)::TemplateInstantiator::TransformTemplateTypeParmType(clang::TypeLocBuilder&, clang::TemplateTypeParmTypeLoc, bool) SemaTemplateInstantiate.cpp:0:0
#6 0x000056170de493a0 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#7 0x000056170de4d258 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformReferenceType(clang::TypeLocBuilder&, clang::ReferenceTypeLoc) SemaTemplateInstantiate.cpp:0:0
#8 0x000056170de493b9 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#9 0x000056170de4d589 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) SemaTemplateInstantiate.cpp:0:0
#10 0x000056170de50b56 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, bool) SemaTemplateInstantiate.cpp:0:0
#11 0x000056170de5459a bool clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateArguments<clang::TemplateArgumentLoc const*>(clang::TemplateArgumentLoc const*, clang::TemplateArgumentLoc const*, clang::TemplateArgumentListInfo&, bool) (.constprop.0) SemaTemplateInstantiate.cpp:0:0
#12 0x000056170de55198 clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformConceptSpecializationExpr(clang::ConceptSpecializationExpr*) SemaTemplateInstantiate.cpp:0:0
#13 0x000056170de6bc33 clang::Sema::SubstConstraintExpr(clang::Expr*, clang::MultiLevelTemplateArgumentList const&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4e47c33)
#14 0x000056170d6b6914 SubstituteConstraintExpression(clang::Sema&, clang::NamedDecl const*, clang::Expr const*) SemaConcept.cpp:0:0
#15 0x000056170d6b917a clang::Sema::AreConstraintExpressionsEqual(clang::NamedDecl const*, clang::Expr const*, clang::NamedDecl const*, clang::Expr const*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x469517a)
#16 0x000056170dd1302a clang::Sema::TemplateParameterListsAreEqual(clang::NamedDecl const*, clang::TemplateParameterList*, clang::NamedDecl const*, clang::TemplateParameterList*, bool, clang::Sema::TemplateParameterListEqualKind, clang::SourceLocation) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4cef02a)
#17 0x000056170dc42560 clang::Sema::IsOverload(clang::FunctionDecl*, clang::FunctionDecl*, bool, bool, bool) (.part.0) SemaOverload.cpp:0:0
#18 0x000056170dc42d7a clang::Sema::CheckOverload(clang::Scope*, clang::FunctionDecl*, clang::LookupResult const&, clang::NamedDecl*&, bool) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4c1ed7a)
#19 0x000056170d77268d clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x474e68d)
#20 0x000056170d787785 clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4763785)
#21 0x000056170d78ad68 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4766d68)
#22 0x000056170d83f0cf clang::Sema::ActOnCXXMemberDeclarator(clang::Scope*, clang::AccessSpecifier, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Expr*, clang::VirtSpecifiers const&, clang::InClassInitStyle) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x481b0cf)
#23 0x000056170d45a390 clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier, clang::ParsedAttributesView const&, clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&, clang::SourceLocation) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4436390)
#24 0x000056170d49afb6 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4476fb6)
#25 0x000056170d53d962 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4519962)
#26 0x000056170d5456ac clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x45216ac)
#27 0x000056170d49a664 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4476664)
#28 0x000056170d49c392 clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&, clang::ParsedAttributes&, clang::TypeSpecifierType, clang::Decl*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4478392)
#29 0x000056170d49c9a3 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x44789a3)
#30 0x000056170d49ebbc clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x447abbc)
#31 0x000056170d46dd3a clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4449d3a)
#32 0x000056170d53cdf7 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4518df7)
#33 0x000056170d5456ac clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x45216ac)
#34 0x000056170d54592a clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x452192a)
#35 0x000056170d47cd2d clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4458d2d)
#36 0x000056170d44ee87 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x442ae87)
#37 0x000056170d4926dc clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x446e6dc)
#38 0x000056170d4925be clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x446e5be)
#39 0x000056170d498187 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4474187)
#40 0x000056170d47cdf5 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4458df5)
#41 0x000056170d44ee87 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x442ae87)
#42 0x000056170d4926dc clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x446e6dc)
#43 0x000056170d498187 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4474187)
#44 0x000056170d47cdf5 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4458df5)
#45 0x000056170d44ee87 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x442ae87)
#46 0x000056170d4926dc clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x446e6dc)
#47 0x000056170d498187 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4474187)
#48 0x000056170d47cdf5 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x4458df5)
#49 0x000056170d44ee87 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x442ae87)
#50 0x000056170d450756 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x442c756)
#51 0x000056170d4413da clang::ParseAST(clang::Sema&, bool, bool) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x441d3da)
#52 0x000056170bfb7e49 clang::FrontendAction::Execute() (/opt/rocm-5.7.0/llvm/bin/clang-17+0x2f93e49)
#53 0x000056170bf3e451 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x2f1a451)
#54 0x000056170c0798d8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0x30558d8)
#55 0x0000561709d8d095 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/rocm-5.7.0/llvm/bin/clang-17+0xd69095)
#56 0x0000561709d8850d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#57 0x0000561709d89bc4 clang_main(int, char**, llvm::ToolContext const&) (/opt/rocm-5.7.0/llvm/bin/clang-17+0xd65bc4)
#58 0x0000561709cca643 main (/opt/rocm-5.7.0/llvm/bin/clang-17+0xca6643)
#59 0x00007faec49a3d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#60 0x00007faec49a3e40 call_init ./csu/../csu/libc-start.c:128:20
#61 0x00007faec49a3e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#62 0x0000561709d84155 _start (/opt/rocm-5.7.0/llvm/bin/clang-17+0xd60155)
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
AMD clang version 17.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-5.7.0 23352 d1e13c532a947d0cbfc94759c00dcf152294aa13)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rocm-5.7.0/llvm/bin
clang++: note: diagnostic msg: Error generating preprocessed source(s).