Open
Description
File:
// a.cpp
#include <boost/date_time.hpp>
Command run:
clang-tidy --checks=-*,bugprone-crtp-constructor-accessibility a.cpp
clang-tidy build from commit 7468718.
Dump:
clang-tidy: /home/victor/llvm/llvm-project/clang/include/clang/Basic/SourceManager.h:509: const ExpansionInfo &clang::SrcMgr::SLocEntry::getExpansion() const: Assertion `isExpansion() && "Not a macro expansion SLocEntry!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./llvm-project/build/bin/clang-tidy --checks=-*,bugprone-crtp-constructor-accessibility gh.cpp
1. <eof> parser at end of file
2. ASTMatcher: Processing 'bugprone-crtp-constructor-accessibility' against:
ClassTemplateSpecializationDecl boost::date_time::base_time : </usr/include/boost/date_time/time.hpp:45:3, line:204:3>
--- Bound Nodes Begin ---
crtp - { ClassTemplateSpecializationDecl boost::date_time::base_time : </usr/include/boost/date_time/time.hpp:45:3, line:204:3> }
derived - { CXXRecordDecl boost::posix_time::ptime : </usr/include/boost/date_time/posix_time/ptime.hpp:32:3, line:71:3> }
--- Bound Nodes End ---
#0 0x00005f88ea1ed58d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/victor/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:11
#1 0x00005f88ea1edacb PrintStackTraceSignalHandler(void*) /home/victor/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:888:1
#2 0x00005f88ea1ebbef llvm::sys::RunSignalHandlers() /home/victor/llvm/llvm-project/llvm/lib/Support/Signals.cpp:105:5
#3 0x00005f88ea1ee1a9 SignalHandler(int, siginfo_t*, void*) /home/victor/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:418:7
#4 0x00007a525f845330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#5 0x00007a525f89eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x00007a525f89eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x00007a525f89eb2c pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x00007a525f84527e raise ./signal/../sysdeps/posix/raise.c:27:6
#9 0x00007a525f8288ff abort ./stdlib/abort.c:81:7
#10 0x00007a525f82881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007a525f83b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#12 0x00005f88ea3fecf8 clang::SrcMgr::SLocEntry::getExpansion() const /home/victor/llvm/llvm-project/clang/include/clang/Basic/SourceManager.h:0:5
#13 0x00005f88eb1797f1 clang::SourceManager::isMacroArgExpansion(clang::SourceLocation, clang::SourceLocation*) const /home/victor/llvm/llvm-project/clang/lib/Basic/SourceManager.cpp:1031:32
#14 0x00005f88eb179c0d clang::SourceManager::getTopMacroCallerLoc(clang::SourceLocation) const /home/victor/llvm/llvm-project/clang/lib/Basic/SourceManager.cpp:1001:3
#15 0x00005f88ee5615d5 clang::edit::Commit::canInsert(clang::SourceLocation, clang::edit::FileOffset&) /home/victor/llvm/llvm-project/clang/lib/Edit/Commit.cpp:233:12
#16 0x00005f88ee5614cb clang::edit::Commit::insert(clang::SourceLocation, llvm::StringRef, bool, bool) /home/victor/llvm/llvm-project/clang/lib/Edit/Commit.cpp:54:46
#17 0x00005f88ecdfc5ff mergeFixits(llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const&, clang::LangOptions const&, llvm::SmallVectorImpl<clang::FixItHint>&) /home/victor/llvm/llvm-project/clang/lib/Frontend/DiagnosticRenderer.cpp:0:16
#18 0x00005f88ecdfbeb8 clang::DiagnosticRenderer::emitDiagnostic(clang::FullSourceLoc, clang::DiagnosticsEngine::Level, llvm::StringRef, llvm::ArrayRef<clang::CharSourceRange>, llvm::ArrayRef<clang::FixItHint>, llvm::PointerUnion<clang::Diagnostic const*, clang::StoredDiagnostic const*>) /home/victor/llvm/llvm-project/clang/lib/Frontend/DiagnosticRenderer.cpp:105:20
#19 0x00005f88eb2dc504 clang::tidy::ClangTidyDiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:443:3
#20 0x00005f88eb0fe6dc clang::DiagnosticsEngine::Report(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) /home/victor/llvm/llvm-project/clang/lib/Basic/Diagnostic.cpp:668:11
#21 0x00005f88eb0fea1b clang::DiagnosticsEngine::ProcessDiag(clang::DiagnosticBuilder const&) /home/victor/llvm/llvm-project/clang/lib/Basic/Diagnostic.cpp:749:3
#22 0x00005f88eb0feb29 clang::DiagnosticsEngine::EmitDiagnostic(clang::DiagnosticBuilder const&, bool) /home/victor/llvm/llvm-project/clang/lib/Basic/Diagnostic.cpp:770:13
#23 0x00005f88ea2c3e58 clang::DiagnosticBuilder::Emit() /home/victor/llvm/llvm-project/clang/include/clang/Basic/Diagnostic.h:1284:28
#24 0x00005f88ea2c2f89 clang::DiagnosticBuilder::~DiagnosticBuilder() /home/victor/llvm/llvm-project/clang/include/clang/Basic/Diagnostic.h:1319:26
#25 0x00005f88eb557b7f clang::tidy::bugprone::CrtpConstructorAccessibilityCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp:174:3
#26 0x00005f88eb2d6ede clang::tidy::ClangTidyCheck::run(clang::ast_matchers::MatchFinder::MatchResult const&) /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp:47:1
#27 0x00005f88eaf74438 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1273:7
#28 0x00005f88eb023d01 clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchersInternal.cpp:103:5
#29 0x00005f88eaf73faf clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::DynTypedNode const&) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1069:7
#30 0x00005f88eaf73cb2 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchDispatch(clang::Decl const*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1088:5
#31 0x00005f88eaf73abd void clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::match<clang::Decl>(clang::Decl const&) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:733:3
#32 0x00005f88eaf768d4 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1493:3
#33 0x00005f88eaff06a9 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTemplateInstantiations(clang::ClassTemplateDecl*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1884:9
#34 0x00005f88eaff0503 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseTemplateInstantiations(clang::ClassTemplateDecl*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:761:50
#35 0x00005f88eaf8048e clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseClassTemplateDecl(clang::ClassTemplateDecl*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1976:1
#36 0x00005f88eaf77517 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/build/tools/clang/include/clang/AST/DeclNodes.inc:542:1
#37 0x00005f88eaf768e1 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1494:3
#38 0x00005f88eafd6236 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1558:7
#39 0x00005f88eaf7ab49 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseNamespaceDecl(clang::NamespaceDecl*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1701:1
#40 0x00005f88eaf76dc7 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/build/tools/clang/include/clang/AST/DeclNodes.inc:188:1
#41 0x00005f88eaf768e1 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1494:3
#42 0x00005f88eafd6236 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1558:7
#43 0x00005f88eaf7ab49 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseNamespaceDecl(clang::NamespaceDecl*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1701:1
#44 0x00005f88eaf76dc7 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/build/tools/clang/include/clang/AST/DeclNodes.inc:188:1
#45 0x00005f88eaf768e1 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1494:3
#46 0x00005f88eafd6236 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1558:7
#47 0x00005f88eaf779b8 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1665:1
#48 0x00005f88eaf76a1f clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/build/tools/clang/include/clang/AST/DeclNodes.inc:24:1
#49 0x00005f88eaf768e1 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1494:3
#50 0x00005f88eaef2d82 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseAST(clang::ASTContext&) /home/victor/llvm/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:192:5
#51 0x00005f88eaef2bec clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1723:11
#52 0x00005f88eaf7637e clang::ast_matchers::internal::(anonymous namespace)::MatchASTConsumer::HandleTranslationUnit(clang::ASTContext&) /home/victor/llvm/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1586:3
#53 0x00005f88ece52ccc clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) /home/victor/llvm/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp:338:23
#54 0x00005f88ed0be08b clang::ParseAST(clang::Sema&, bool, bool) /home/victor/llvm/llvm-project/clang/lib/Parse/ParseAST.cpp:190:12
#55 0x00005f88ece075e9 clang::ASTFrontendAction::ExecuteAction() /home/victor/llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1341:1
#56 0x00005f88ece07036 clang::FrontendAction::Execute() /home/victor/llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1225:7
#57 0x00005f88ecd25553 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/victor/llvm/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1055:23
#58 0x00005f88eb2a3c33 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) /home/victor/llvm/llvm-project/clang/lib/Tooling/Tooling.cpp:463:14
#59 0x00005f88eb2c1e49 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef)::ActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/ClangTidy.cpp:577:37
#60 0x00005f88eb2a3afb clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) /home/victor/llvm/llvm-project/clang/lib/Tooling/Tooling.cpp:438:18
#61 0x00005f88eb2a2cb8 clang::tooling::ToolInvocation::run() /home/victor/llvm/llvm-project/clang/lib/Tooling/Tooling.cpp:423:3
#62 0x00005f88eb2a4e22 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) /home/victor/llvm/llvm-project/clang/lib/Tooling/Tooling.cpp:621:11
#63 0x00005f88eb2bdf98 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef) /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/ClangTidy.cpp:598:8
#64 0x00005f88eb313515 clang::tidy::clangTidyMain(int, char const**) /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:713:7
#65 0x00005f88e9e4d8d2 main /home/victor/llvm/llvm-project/clang-tools-extra/clang-tidy/tool/ClangTidyToolMain.cpp:20:3
#66 0x00007a525f82a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#67 0x00007a525f82a28b call_init ./csu/../csu/libc-start.c:128:20
#68 0x00007a525f82a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#69 0x00005f88e9e4d7e5 _start (./llvm-project/build/bin/clang-tidy+0x419a7e5)
Aborted (core dumped)