#include <iostream>
#include <typeinfo>
using namespace std;
int main()
{
int s = 2;
unsigned int u = 3;
auto k = s + u;
if (typeid(k) == typeid(s))
cout << "signed" << endl;
else if (typeid(k) == typeid(u))
cout << "unsigned" << endl;
else
cout << "error" << endl;
}
GCC によるこのプログラムの出力は次のとおりです。
unsigned
これは未定義または実装定義の動作であると確信していますが、ドットを標準と結び付けることができないようです。
標準のどこにこれが書かれているのか教えていただけますか?