Despite not fully answering the original question, this is probably what most people googling this wanted to see.
For GCC:
$ cat test.cpp
#include <iostream>
int main(int argc, char **argv)
{
std::cout << __func__ << std::endl
<< __FUNCTION__ << std::endl
<< __PRETTY_FUNCTION__ << std::endl;
}
$ g++ test.cpp
$ ./a.out
main
main
int main(int, char**)