char t = 'a';
char * p1 = &t;
char** p2 = &p1;
std::cout << p2 << " " << *p2 << " " << **p2 << '\n';
I am using clang and -fsanitize=address which complains about memory access overflowing a variable and terminates my program, however when I step through with gdb I can see that yes everything is defined and it should print two addresses followed by 'a'.
If I remove the middle "*p2" it runs fine, ie it is the printing of a half-dereferenced pointer to a pointer causing me issues.