#include <iostream>
#include <type_traits>
using namespace std;
enum { X, Y };
int const Z = 1;
int main() {
static_assert( is_same<decltype(X), decltype(Y)>::value, "XY" );
static_assert( is_same<decltype(X), decltype(Z)>::value, "XZ" );
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgplbnVtIHsgWCwgWSB9OwppbnQgY29uc3QgWiA9IDE7CgppbnQgbWFpbigpIHsKCXN0YXRpY19hc3NlcnQoIGlzX3NhbWU8ZGVjbHR5cGUoWCksIGRlY2x0eXBlKFkpPjo6dmFsdWUsICJYWSIgKTsKCXN0YXRpY19hc3NlcnQoIGlzX3NhbWU8ZGVjbHR5cGUoWCksIGRlY2x0eXBlKFopPjo6dmFsdWUsICJYWiIgKTsKfQ==
prog.cpp: In function 'int main()':
prog.cpp:10:2: error: static assertion failed: XZ
static_assert( is_same<decltype(X), decltype(Z)>::value, "XZ" );
^