No one is right or wrong the comparation between “welcome” and “bye” is address comparation and in our example the address layout of “welcome” under gcc or clang is smaller/bigger then “bye” which explain the difference between the compilers. After that the result is compared with std::string (“hi”) which means that the previous result is implicit cast to std::string and the 2 strings are compared.