<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55293>55293</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy Assertion failed: "Don't expect to ever get here in template Context." in bugprone\ImplicitWideningOfMultiplicationResultCheck.cpp
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sean-mcmanus
      </td>
    </tr>
</table>

<pre>
    With clang-tidy 14.0.3 (or 14.0.0, and 13 too I believe), we have a closed source project that gives the assertion (Debug only) and crash below with a certain configuration (compile_commands.json and .clang-tidy files). Unfortunately, I'm not sure of a good way to share the repro or build a sample code that repros it. Adding the MSVC/Windows system include paths to the compile_command.json or environment causes the issue to not repro (i.e. it only repros when the include paths are incorrect): `-I\"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.31.31103/include\" -I\"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.31.31103/atlmfc/include\" -I\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/um\" -I\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt\" -I\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/shared\" -I\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/winrt\" -I\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt\"`

```
Assertion failed: !ETy->isDependentType() && !Ty->isDependentType() && "Don't expect to ever get here in template Context.", file D:\a\_work\1\s\clang-tools-extra\clang-tidy\bugprone\ImplicitWideningOfMultiplicationResultCheck.cpp, line 79
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: <path>/clang-tidy.exe --header-filter=(<path>) --export-fixes=<pathTo>.yaml --quiet <pathTo>/source.cpp -p=<path>
1.      <eof> parser at end of file
 #0 0x00007ff75be2b59c HandleAbort D:\a\_work\1\s\llvm\lib\Support\Windows\Signals.inc:408:0
 #1 0x00007ff906e08e05 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xa8e05)
 #2 0x00007ff906e0ab29 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xaab29)
 #3 0x00007ff906e1094f (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xb094f)
 #4 0x00007ff906e0e881 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xae881)
 #5 0x00007ff906e1158f (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xb158f)
 #6 0x00007ff758717706 clang::tidy::bugprone::ImplicitWideningOfMultiplicationResultCheck::handleImplicitCastExpr(class clang::ImplicitCastExpr const *) D:\a\_work\1\s\clang-tools-extra\clang-tidy\bugprone\ImplicitWideningOfMultiplicationResultCheck.cpp:78:0
 #7 0x00007ff75871949e clang::tidy::bugprone::ImplicitWideningOfMultiplicationResultCheck::check(struct clang::ast_matchers::MatchFinder::MatchResult const &) D:\a\_work\1\s\clang-tools-extra\clang-tidy\bugprone\ImplicitWideningOfMultiplicationResultCheck.cpp:266:0
 #8 0x00007ff75cb38264 clang::tidy::ClangTidyCheck::run(struct clang::ast_matchers::MatchFinder::MatchResult const &) D:\a\_work\1\s\clang-tools-extra\clang-tidy\ClangTidyCheck.cpp:46:0
 #9 0x00007ff75c794593 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::MatchVisitor::visitMatch D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1060:0
#10 0x00007ff75c8c4a71 clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(class clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor *) D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchersInternal.cpp:105:0
#11 0x00007ff75c793710 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::matchWithFilter D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:868:0
#12 0x00007ff75c7938fa clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::matchDispatch D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:891:0
#13 0x00007ff75c7c429e clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::match<clang::Stmt> D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:719:0
#14 0x00007ff75c7916a2 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::TraverseStmt D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1260:0
#15 0x00007ff75c8201ec clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseEnumConstantDecl D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1968:0
#16 0x00007ff75c812e30 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDecl D:\a\_work\1\a\build_x64\tools\clang\include\clang\AST\DeclNodes.inc:523:0
#17 0x00007ff75c7915c4 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::TraverseDecl D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1248:0
#18 0x00007ff75c814acd clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDeclContextHelper D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1397:0
#19 0x00007ff75c8208c8 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseEnumDecl D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1862:0
#20 0x00007ff75c812814 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDecl D:\a\_work\1\a\build_x64\tools\clang\include\clang\AST\DeclNodes.inc:273:0
#21 0x00007ff75c7915c4 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::TraverseDecl D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1248:0
#22 0x00007ff75c814acd clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDeclContextHelper D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1397:0
#23 0x00007ff75c83cfdf clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseNamespaceDecl D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1534:0
#24 0x00007ff75c812506 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDecl D:\a\_work\1\a\build_x64\tools\clang\include\clang\AST\DeclNodes.inc:131:0
#25 0x00007ff75c7915c4 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::TraverseDecl D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1248:0
#26 0x00007ff75c814acd clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDeclContextHelper D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1397:0
#27 0x00007ff75c88b626 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseTranslationUnitDecl D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:1498:0
#28 0x00007ff75c8130d0 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseDecl D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:679:0
#29 0x00007ff75c7915c4 clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor::TraverseDecl D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1248:0
#30 0x00007ff75c77b928 clang::RecursiveASTVisitor<clang::ast_matchers::internal::`anonymous namespace'::MatchASTVisitor>::TraverseAST D:\a\_work\1\s\clang\include\clang\AST\RecursiveASTVisitor.h:201:0
#31 0x00007ff75c7666c2 clang::ast_matchers::MatchFinder::matchAST(class clang::ASTContext &) D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1476:0
#32 0x00007ff75c796926 clang::ast_matchers::internal::`anonymous namespace'::MatchASTConsumer::HandleTranslationUnit D:\a\_work\1\s\clang\lib\ASTMatchers\ASTMatchFinder.cpp:1340:0
#33 0x00007ff75e6ad685 clang::MultiplexConsumer::HandleTranslationUnit(class clang::ASTContext &) D:\a\_work\1\s\clang\lib\Frontend\MultiplexConsumer.cpp:292:0
#34 0x00007ff75eaad878 clang::ParseAST(class clang::Sema &, bool, bool) D:\a\_work\1\s\clang\lib\Parse\ParseAST.cpp:178:0
#35 0x00007ff75e6b7d77 clang::ASTFrontendAction::ExecuteAction(void) D:\a\_work\1\s\clang\lib\Frontend\FrontendAction.cpp:1076:0
#36 0x00007ff75e6b772e clang::FrontendAction::Execute(void) D:\a\_work\1\s\clang\lib\Frontend\FrontendAction.cpp:971:0
#37 0x00007ff75e67d63a clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) D:\a\_work\1\s\clang\lib\Frontend\CompilerInstance.cpp:1036:0
#38 0x00007ff75ca9ed81 clang::tooling::FrontendActionFactory::runInvocation(class std::shared_ptr<class clang::CompilerInvocation>, class clang::FileManager *, class std::shared_ptr<class clang::PCHContainerOperations>, class clang::DiagnosticConsumer *) D:\a\_work\1\s\clang\lib\Tooling\Tooling.cpp:423:0
#39 0x00007ff75cb1ba0f `clang::tidy::runClangTidy'::`2'::ActionFactory::runInvocation D:\a\_work\1\s\clang-tools-extra\clang-tidy\ClangTidy.cpp:566:0
#40 0x00007ff75caa0f13 clang::tooling::ToolInvocation::runInvocation(char const *, class clang::driver::Compilation *, class std::shared_ptr<class clang::CompilerInvocation>, class std::shared_ptr<class clang::PCHContainerOperations>) D:\a\_work\1\s\clang\lib\Tooling\Tooling.cpp:398:0
#41 0x00007ff75caa0d11 clang::tooling::ToolInvocation::run(void) D:\a\_work\1\s\clang\lib\Tooling\Tooling.cpp:383:0
#42 0x00007ff75caa24cc clang::tooling::ClangTool::run(class clang::tooling::ToolAction *) D:\a\_work\1\s\clang\lib\Tooling\Tooling.cpp:577:0
#43 0x00007ff75cb17fd3 clang::tidy::runClangTidy(class clang::tidy::ClangTidyContext &, class clang::tooling::CompilationDatabase const &, class llvm::ArrayRef<class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>>>, class llvm::IntrusiveRefCntPtr<class llvm::vfs::OverlayFileSystem>, bool, bool, class llvm::StringRef) D:\a\_work\1\s\clang-tools-extra\clang-tidy\ClangTidy.cpp:588:0
#44 0x00007ff75843ed17 clang::tidy::clangTidyMain(int, char const **) D:\a\_work\1\s\clang-tools-extra\clang-tidy\tool\ClangTidyMain.cpp:502:0
#45 0x00007ff75843dcbc main D:\a\_work\1\s\clang-tools-extra\clang-tidy\tool\ClangTidyToolMain.cpp:21:0
#46 0x00007ff75b447fd9 invoke_main d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0
#47 0x00007ff75b447e7e __scrt_common_main_seh d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#48 0x00007ff75b447d3e __scrt_common_main d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0
#49 0x00007ff75b44806e mainCRTStartup d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#50 0x00007ff9a89554e0 (C:\WINDOWS\System32\KERNEL32.DLL+0x154e0)
#51 0x00007ff9a9b2485b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x485b)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztW1tT27oW_jXhRUPGlu8PPNAkzGZ2aTsNe3fOEy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