Hi,
I am trying to write a new check that bans certain builtin functions (e.g. __builtin_memcpy
), if they are used by the user directly. My check matches on CallExpr and I then get the name of the function called, etc.
My check basically works, but there is one very odd example where it does not.
potato.cpp:1:7: warning: __builtin_memcpy is not an allowed builtin
class Potato
^
Barring bugs in clang, I guess there is a legitimate reason why this node was synthesised and inserted into the tree. Is there a way to figure out if such a node is “coming from source”?
I’ve read clang: clang::CallExpr Class Reference but I couldn’t find anything obvious.
The source code is:
struct Potato
{
int data_[2][2];
};
void Wibble()
{
Potato a;
Potato b;
a = b;
}