Issue 208735
Summary [clang-tid] misc-const-correctness crashes on file including mlir/Pass/Pass.h
Labels mlir
Assignees
Reporter AndreyPavlenko
    Reproducer:
```cpp
#include "mlir/Pass/Pass.h"

int main() { return 0; }
```
```bash
clang-tidy --checks='misc-const-correctness' reproducer.cpp -- -std=c++17 -Illvm/include -Illvm-project/mlir/include -Illvm-project/llvm/include
```
Error:
```bash
Stack dump:
0. Program arguments: clang-tidy --checks=misc-const-correctness reproducer.cpp -- -std=c++17 -Illvm/include -Illvm-project/mlir/include -Illvm-project/llvm/include
1.      <eof> parser at end of file
2. ASTMatcher: Processing 'misc-const-correctness' against:
 CXXMethodDecl mlir::AttrTypeSubElementReplacements<mlir::Attribute>::take_front : <llvm/include/mlir/IR/AttrTypeSubElements.h:363:3, line:367:3>
--- Bound Nodes Begin ---
    decl-stmt - { DeclStmt : <llvm/include/mlir/IR/AttrTypeSubElements.h:364:5, col:47> }
 function-decl - { CXXMethodDecl mlir::AttrTypeSubElementReplacements<mlir::Attribute>::take_front : <llvm/include/mlir/IR/AttrTypeSubElements.h:363:3, line:367:3> }
    scope - { CompoundStmt : <llvm/include/mlir/IR/AttrTypeSubElements.h:363:38, line:367:3> }
    value - { VarDecl elements : <llvm/include/mlir/IR/AttrTypeSubElements.h:364:5, col:46> }
--- Bound Nodes End ---
 #0 0x00007f64fe629d3f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-23/bin/../lib/libLLVM.so.23.0+0x5029d3f)
 #1 0x00007f64fe627677 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-23/bin/../lib/libLLVM.so.23.0+0x5027677)
 #2 0x00007f64fe62abda (/usr/lib/llvm-23/bin/../lib/libLLVM.so.23.0+0x502abda)
 #3 0x00007f64f9092330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007f65056b462a clang::ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(clang::Expr const*) (/usr/lib/llvm-23/bin/../lib/libclang-cpp.so.23.0+0x2df562a)
 #5 0x00007f65056a990b clang::ExprMutationAnalyzer::Analyzer::findMutation(clang::Expr const*) (/usr/lib/llvm-23/bin/../lib/libclang-cpp.so.23.0+0x2dea90b)
 #6 0x00007f65056b4f16 clang::ExprMutationAnalyzer::Analyzer::tryEachDeclRef(clang::Decl const*, clang::Stmt const* (clang::ExprMutationAnalyzer::Analyzer::*)(clang::Expr const*)) (/usr/lib/llvm-23/bin/../lib/libclang-cpp.so.23.0+0x2df5f16)
 #7 0x00005577fa9fa58e clang::tidy::misc::ConstCorrectnessCheck::isMutated(clang::VarDecl const*, clang::Stmt const*, clang::FunctionDecl const*, clang::ASTContext*) (/usr/lib/llvm-23/bin/clang-tidy+0x6d758e)
 #8 0x00005577fa9fa058 (/usr/lib/llvm-23/bin/clang-tidy+0x6d7058)
```
```
Ubuntu 24.04.4
clang-tidy     1:23.0-71~exp1~20260314215455.16 amd64 
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to