Skip to content

ROOT 6.30.01 + C++20 crashes when interpreting specially crafted macro #14230

@ktf

Description

@ktf

Check duplicate issues.

  • Checked for duplicates

Description

I am not sure what is actually happening, however the following macro:

 namespace o2::zdc
 {
  class MCLabel;
 } // namespace o2::zdc
 
 void readZDCDigits()
 {
   std::vector<o2::zdc::BCData> zdcBCData;
 }

crashes ROOT when compiling with C++20 enabled and loading the macro with:

root readZDCDigits.C

The same macro, when using C++17 works. The produced stacktrace is:

   ------------------------------------------------------------------
  | Welcome to ROOT 6.30/01                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Dec 14 2023, 10:22:37                   |
  | From heads/alice/v6-30-01@v6-30-01-3-g3808ff669e                 |
  | With Apple clang version 15.0.0 (clang-1500.1.0.2.5)             |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------


Processing readZDCDigits.C...
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::EnterTemplatedContext(clang::Scope*, clang::DeclContext*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::EnterTemplatedContext(clang::Scope*, clang::DeclContext*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::ActOnReenterTemplateScope(clang::Decl*, llvm::function_ref<clang::Scope* ()>) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ReenterTemplateScopes(clang::Parser::MultiParseScope&, clang::Decl*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributesWithRange&, unsigned int, clang::Decl*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributesWithRange&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::IncrementalParser::ParseInternal(llvm::StringRef) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::Interpreter::parseForModule(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] ExecAutoParse(char const*, bool, cling::Interpreter*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TCling.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] TCling::AutoParseImplRecurse(char const*, bool) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TCling.cxx:6416
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] TCling::AutoParse(char const*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TCling.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] TClingCallbacks::LookupObject(clang::TagDecl*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TClingCallbacks.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::MultiplexInterpreterCallbacks::LookupObject(clang::TagDecl*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::MultiplexExternalSemaSource::CompleteType(clang::TagDecl*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] checkArithmeticIncompletePointerType(clang::Sema&, clang::SourceLocation, clang::Expr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] checkArithmeticBinOpPointerOperands(clang::Sema&, clang::SourceLocation, clang::Expr*, clang::Expr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::CheckSubtractionOperands(clang::ActionResult<clang::Expr*, true>&, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::QualType*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::CreateBuiltinBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::RebuildCXXOperatorCallExpr(clang::OverloadedOperatorKind, clang::SourceLocation, clang::Expr*, clang::Expr*, clang::Expr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXOperatorCallExpr(clang::CXXOperatorCallExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXNamedCastExpr(clang::CXXNamedCastExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformReturnStmt(clang::ReturnStmt*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_11>(long) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberExpr(clang::Expr*, bool, clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::SourceLocation, clang::ValueDecl*, clang::DeclAccessPair, bool, clang::DeclarationNameInfo const&, clang::QualType, clang::ExprValueKind, clang::ExprObjectKind, clang::TemplateArgumentListInfo const*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberExpr(clang::Expr*, bool, clang::SourceLocation, clang::CXXScopeSpec const*, clang::SourceLocation, clang::ValueDecl*, clang::DeclAccessPair, bool, clang::DeclarationNameInfo const&, clang::QualType, clang::ExprValueKind, clang::ExprObjectKind, clang::TemplateArgumentListInfo const*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberReferenceExpr(clang::Expr*, clang::QualType, clang::SourceLocation, bool, clang::CXXScopeSpec const&, clang::SourceLocation, clang::NamedDecl*, clang::LookupResult&, clang::TemplateArgumentListInfo const*, clang::Scope const*, bool, clang::Sema::ActOnMemberAccessExtraArgs*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformMemberExpr(clang::MemberExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXOperatorCallExpr(clang::CXXOperatorCallExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformExprs(clang::Expr* const*, unsigned int, bool, llvm::SmallVectorImpl<clang::Expr*>&, bool*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_11>(long) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberExpr(clang::Expr*, bool, clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::SourceLocation, clang::ValueDecl*, clang::DeclAccessPair, bool, clang::DeclarationNameInfo const&, clang::QualType, clang::ExprValueKind, clang::ExprObjectKind, clang::TemplateArgumentListInfo const*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberExpr(clang::Expr*, bool, clang::SourceLocation, clang::CXXScopeSpec const*, clang::SourceLocation, clang::ValueDecl*, clang::DeclAccessPair, bool, clang::DeclarationNameInfo const&, clang::QualType, clang::ExprValueKind, clang::ExprObjectKind, clang::TemplateArgumentListInfo const*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberReferenceExpr(clang::Expr*, clang::QualType, clang::SourceLocation, bool, clang::CXXScopeSpec const&, clang::SourceLocation, clang::NamedDecl*, clang::LookupResult&, clang::TemplateArgumentListInfo const*, clang::Scope const*, bool, clang::Sema::ActOnMemberAccessExtraArgs*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildMemberReferenceExpr(clang::Expr*, clang::QualType, clang::SourceLocation, bool, clang::CXXScopeSpec&, clang::SourceLocation, clang::NamedDecl*, clang::DeclarationNameInfo const&, clang::TemplateArgumentListInfo const*, clang::Scope const*, clang::Sema::ActOnMemberAccessExtraArgs*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXDependentScopeMemberExpr(clang::CXXDependentScopeMemberExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_11>(long) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] MarkExprReferenced(clang::Sema&, clang::SourceLocation, clang::Decl*, clang::Expr*, bool, llvm::DenseMap<clang::VarDecl const*, int, llvm::DenseMapInfo<clang::VarDecl const*>, llvm::detail::DenseMapPair<clang::VarDecl const*, int>>&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] CreateFunctionRefExpr(clang::Sema&, clang::FunctionDecl*, clang::NamedDecl*, clang::Expr const*, bool, clang::SourceLocation, clang::DeclarationNameLoc const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::BuildCallToObjectOfClassType(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*, clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::StmtDiscardKind) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_11>(long) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::FinalizeVarWithDestructor(clang::VarDecl*, clang::RecordType const*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Sema::ActOnUninitializedDecl(clang::Decl*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributesWithRange&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseCompoundStatementBody(bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::IncrementalParser::ParseInternal(llvm::StringRef) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::Interpreter::loadHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, cling::Transaction**) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::MetaSema::actOnLCommand(llvm::StringRef, cling::Transaction**) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (no debug info)
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TCling.cxx:2445
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TCling.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCling.6.30.01.so] TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/metacling/src/TCling.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libCore.6.30.01.so] TApplication::ExecuteFile(char const*, int*, bool) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/base/src/TApplication.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libRint.6.30.01.so] TRint::ProcessLineNr(char const*, char const*, int*) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/rint/src/TRint.cxx:820
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/lib/libRint.6.30.01.so] TRint::Run(bool) /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/core/rint/src/TRint.cxx:0
[/Users/ktf/src/sw/osx_arm64/ROOT/alice-v6-30-01-local6/bin/root.exe] main /Users/ktf/src/sw/SOURCES/ROOT/alice-v6-30-01/0/main/src/rmain.cxx:86
[/usr/lib/dyld] start (no debug info)

Notice that every bit of that script seems to be necessary.

  • If I remove the vector and simply create one instance, it works.
  • If I change the name of the forward declared class to something else, existing or not, it works.
  • If I remove the forward declaration, it works.

Reproducer

→ root -b -q
   ------------------------------------------------------------------
  | Welcome to ROOT 6.30/01                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Dec 14 2023, 10:22:37                   |
  | From heads/alice/v6-30-01@v6-30-01-3-g3808ff669e                 |
  | With Apple clang version 15.0.0 (clang-1500.1.0.2.5)             |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

ROOT version

Both 6.28.04 and 6.30.01 have the same issue, with or without ALICE specific patches. The issue seems to be C++20 related.

Installation method

aliBuild

Operating system

macOS, Linux

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions