<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/97779>97779</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-check crashes with option --syntax-tree-dump for "default" function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickhuang99
</td>
</tr>
</table>
<pre>
**clang-check** always crash for option **--syntax-tree-dump ** when a function has key word like _default_ or _delete_
`$ cat /tmp/test7.cpp
struct Foo {
Foo() = default;
};
$ clang-check --syntax-tree-dump /tmp/test7.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "/tmp/test7.cpp"
No compilation database found in /tmp or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
#0 0x00007449e5e3fd01 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3fd01)
#1 0x00007449e5e3da0c llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3da0c)
#2 0x00007449e5e40236 (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe40236)
#3 0x00007449e4842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007449ee0b6abd (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x26b6abd)
#5 0x00007449ee0bb1e2 (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x26bb1e2)
#6 0x00007449ee08e683 (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x268e683)
#7 0x00007449ee088e3b (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2688e3b)
#8 0x00007449ee08c45b (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x268c45b)
#9 0x00007449ee088c9f (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2688c9f)
#10 0x00007449ee09118b (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x269118b)
#11 0x00007449ee088f76 (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2688f76)
#12 0x00007449ee08777b clang::syntax::buildSyntaxTree(clang::syntax::Arena&, clang::ASTContext&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x268777b)
#13 0x00000000004081ad (/usr/lib/llvm-14/bin/clang-check+0x4081ad)
#14 0x00007449ec404824 clang::ParseAST(clang::Sema&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa04824)
#15 0x00007449edf14b57 clang::FrontendAction::Execute() (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2514b57)
#16 0x00007449ede6c3a6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x246c3a6)
#17 0x00007449ee112423 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2712423)
#18 0x00007449ee112175 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2712175)
#19 0x00007449ee111183 clang::tooling::ToolInvocation::run() (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2711183)
#20 0x00007449ee113d0e clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2713d0e)
#21 0x000000000040731e (/usr/lib/llvm-14/bin/clang-check+0x40731e)
#22 0x00007449e4829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#23 0x00007449e4829e40 call_init ./csu/../csu/libc-start.c:128:20
#24 0x00007449e4829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#25 0x0000000000405e65 (/usr/lib/llvm-14/bin/clang-check+0x405e65)
Segmentation fault (core dumped)
$
`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykmF1z4jgWhn-NuFFByfIXvuCCJk3NbM30TE1Se0vJ0gE0MZJLkjvh329JNsHywm6G9AXtWD7Pec-rL1vMWnlQACuUf0P504x17qjNSkn-euyYOlTVrNbivEJ0jeiaN0wd5vwI_LW_gVnzxs4Wc8PsEe-1wbp1UivcN8_n9qwce587AzAX3akdGvDbERRmeN8pHp4_Motf4YzftBG4ka-A8U7AnnWN22Ft_B8NONgh8oTIevgtCKIZ5sxhRLfu1PpfsK5c8LbF_TPWmY47vNUao_Jbf2-rNaJLRCuM0ic8ZEHp0IrKp-u1x19rxjfrmWbuQ78bow1-O8oGsDNnqQ7YadxoJjDDXJ9a2bBQuWCO1cwCSoeyNrprBFbaYdY5PRfggLubIcHwvc-AKL0hhNKe-EPfC--UwFINRXifmTrjlhlQDgtpgDttzj1kL99BzEec-Ug5HperW1C-3hAxrg__0Nh2_Nhr1maa4m-r1T_K8K_nP378kwR_dSrEvUl31J3D-4Yd7KJvw4imBJN3Qggps6yCHNK9IAlump8n3znp2p5tf_Gnkco9O8ZfXwzjgOjy-pBhbzttnQF2QrRAdIOlcmGw-TG3bWSN6PZ9WeyKbN5I1b3PD6rrG3777d-_z5NsYfUiQfQbee8VIFpdJSYTiYIRfkviX516lgfFml-YEg0Yexnyj6jwSSIVNFaREZoWD6FDZIROx-hsmdGckk-guYcWARpCImY2ZgKpC1aLzzD7qd-2QXAW4LQI0RE-n-DrBOjjeB8d4YsYv4RimT6MD9ERvpzgl5DWj-N9dIRfTvA8y7-A99ERvpqq59X-C-p5tf_A-9lGYnyVJMvH1YfoCJ9M1e_Lz8yje-r3ZRHh6QRflmXdb2iX1cLvZv113clGPIcbLwb8mnbnwbUBxYalbfTI-vllo5WDdxfaPrPS3CnDq4zKuCwJ_b-MLBN2m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