| Issue |
204137
|
| Summary |
clang-tidy 18.1 crashes when running `cppcoreguidelines-*` checks
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
thijsjanzen
|
### Environment
* LLVM/Clang-Tidy version: 18.1
* Command:
```bash
clang-tidy temperature.cpp -checks=cppcoreguidelines-* -- -std=c++17 -Wall
```
### Crash Output
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: clang-tidy temperature.cpp -checks=cppcoreguidelines-* -- -std=c++17 -Wall
1. <eof> parser at end of file
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM.so.18.1 0x00007e17495a63bf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63
1 libLLVM.so.18.1 0x00007e17495a44f9 llvm::sys::RunSignalHandlers() + 89
2 libLLVM.so.18.1 0x00007e17495a6b00
3 libc.so.6 0x00007e1748045330
4 libclang-cpp.so.18.1 0x00007e1752f63155
5 libclang-cpp.so.18.1 0x00007e1752f66368
6 libclang-cpp.so.18.1 0x00007e1752f60381
7 libclang-cpp.so.18.1 0x00007e1752f5bf2e
8 libclang-cpp.so.18.1 0x00007e1752f5da1b
9 libclang-cpp.so.18.1 0x00007e1752f5be4c
10 libclang-cpp.so.18.1 0x00007e1752f78e3b
11 libclang-cpp.so.18.1 0x00007e1752f5c16f
12 libclang-cpp.so.18.1 0x00007e1752f5baf6
13 libclang-cpp.so.18.1 0x00007e1752f5ba9d
14 libclang-cpp.so.18.1 clang::ento::CheckerManager::runCheckersOnASTDecl(clang::Decl const*, clang::ento::AnalysisManager&, clang::ento::BugReporter&) + 385
15 libclang-cpp.so.18.1 0x00007e17530b4127
16 libclang-cpp.so.18.1 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) + 44
17 libclang-cpp.so.18.1 clang::ParseAST(clang::Sema&, bool, bool) + 598
18 libclang-cpp.so.18.1 clang::FrontendAction::Execute() + 92
19 libclang-cpp.so.18.1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 708
20 libclang-cpp.so.18.1 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) + 425
21 clang-tidy 0x00005de9a5071ab3
22 libclang-cpp.so.18.1 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) + 292
23 libclang-cpp.so.18.1 clang::tooling::ToolInvocation::run() + 1231
24 libclang-cpp.so.18.1 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) + 5041
25 clang-tidy clang::tidy::runClangTidy(...) + 1083
26 clang-tidy clang::tidy::clangTidyMain(int, char const**) + 10005
27 libc.so.6 0x00007e174802a1ca
28 libc.so.6 0x00007e174802a28b __libc_start_main + 139
29 clang-tidy 0x00005de9a43e8fe5 _start + 37
```
contents of temperature.cpp:
```
/* This program converts temperatures and provides a weather
advice accordingly */
#include <iostream>
#include <cmath>
int main() {
// declare required variables
double celsius(0.0);
double fahrenheit(0.0);
bool use_fahrenheit(false);
double temp(0.0);
std::cout << "Do you want to enter a temperature in Celsius or Fahrenheit? 0/1 ";
std::cin >> use_fahrenheit;
std::cout << std::endl;
std::cout << "Please enter the temperature ";
std::cin >> temp;
std::cout << std::endl;
if (use_fahrenheit) { // convert from fahrenheit to celsius
celsius = (temp - 32) * 5.0 / 9.0;
fahrenheit = temp;
} else {
celsius = temp;
fahrenheit = 32 + temp * 9.0 / 5.0;
}
// basic output
std::cout << "The temperature is: " << celsius << " degrees Celsius, or: " << fahrenheit << " degrees Fahrenheit" << std::endl;
// provide weather advice
if (celsius < 0) {
std::cout << "Advisory: It is freezing outside, dress warmly!" << std::endl;
}
else if (celsius >= 0 && celsius < 10) {
std::cout << "Advisory: It is chilly outside, you might want to wear mittens!" << std::endl;
}
else if (celsius >= 10 && celsius < 20) {
std::cout << "Advisory: the weather can still be cool, a light jacket is advised." << std::endl;
}
else if (celsius >= 20 && celsius < 30) {
std::cout << "Advisory: The weather is pleasant, enjoy your day!" << std::endl;
}
if (celsius >= 30) {
std::cout << "Advisory: it’s hot! Stay hydrated and avoid direct sunlight" << std::endl;
}
//terminate program
return 0;
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs