Difference on address of const reference to ternary operator between clang and gcc
问题 I have a vague idea of what's going on here... and it has to do with this but I'm wondering why clang++ and g++ handle this differently. Where is the undefined behaviour arround here? Note: this has nothing to do with templates - I just use them to make the example more compact. It's all about the type of whatever . #include <iostream> #include <vector> template <typename T> void test() { T whatever = 'c'; const char a = 'a'; std::cout << "begin: " << (void*)&a << std::endl; const char & me =