Huh. For whatever reason, my clang-tidy-16 acts as if IgnoreUnlessSpelledInSource
is set. That’s weird.
It came from here: https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
I can’t reproduce with clang-tidy-15. clang-query-16 only matches if traversal is set to IgnoreUnlessSpelledInSource
.
$ /opt/clang+llvm-15.0.2-x86_64-unknown-linux-gnu/bin/clang-query wallet/wallet.cpp – -DHAVE_BUILD_INFO -I. -I./minisketch/include -I./secp256k1/include -I./univalue/include -I./leveldb/include -isystem /home/cory/dev/bitcoin2/depends/x86_64-pc-linux-gnu/include -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -DHAVE_CONFIG_H -std=c++17 -O2
clang-query> m cxxMemberCallExpr(thisPointerType(qualType(hasDeclaration(cxxRecordDecl(hasName(“CWallet”))))),callee(cxxMethodDecl(hasName(“WalletLogPrintf”))),hasArgument(0, stringLiteral().bind(“logstring”)))
0 matches.
clang-query> set traversal IgnoreUnlessSpelledInSource
clang-query> m cxxMemberCallExpr(thisPointerType(qualType(hasDeclaration(cxxRecordDecl(hasName(“CWallet”))))),callee(cxxMethodDecl(hasName(“WalletLogPrintf”))),hasArgument(0, stringLiteral().bind(“logstring”)))
…
Match #33:
/home/cory/dev/bitcoin2/src/wallet/wallet.cpp:4149:36: note: “logstring” binds here
wallet.WalletLogPrintf(“Making a new watchonly wallet containing the unwatched solvable scripts\n”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cory/dev/bitcoin2/src/wallet/wallet.cpp:4149:13: note: “root” binds here
wallet.WalletLogPrintf(“Making a new watchonly wallet containing the unwatched solvable scripts\n”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 matches
I don’t think this is worth spending any more time on, but I still don’t understand why it’s different.