#include <string>
template < class T, class U>
struct sametype { } ;
template < class T>
struct sametype< T,T> { typedef int same; } ;
int main( ) {
int & refint( ) ;
std:: string str( ) ;
std:: string const conststr( ) ;
auto i1 = 1 ; // deduce(1) gives T=int so int i1
auto i2 = i1; // deduce(i1) gives T=int so int i2
auto i3 = refint( ) ; // deduce(refint()) gives T=int so int i3
const auto ci1 = i1; // deduce(i1) gives T=int so const int ci1
auto i4 = ci1; // deduce(ci1) gives T=int so int i4
auto s1 = std:: string ( ) ; // std::string s1
auto s2 = str( ) ; // std::string s2
auto s3 = conststr( ) ; // std::string s3
extern decltype( refint( ) ) ir1; // int &i
sametype< decltype ( i1) , int > :: same check_i1;
sametype< decltype ( i2) , int > :: same check_i2;
sametype< decltype ( i3) , int > :: same check_i3;
sametype< decltype ( i4) , int > :: same check_i4;
sametype< decltype ( ci1) , const int > :: same check_ci1;
sametype< decltype ( ir1) , int & > :: same check_ir1;
sametype< decltype ( s1) , std:: string > :: same check_s1;
sametype< decltype ( s2) , std:: string > :: same check_s2;
sametype< decltype ( s3) , std:: string > :: same check_s3;
}
I2luY2x1ZGUgPHN0cmluZz4KCiAgICB0ZW1wbGF0ZSA8Y2xhc3MgVCwgY2xhc3MgVT4KICAgIHN0cnVjdCBzYW1ldHlwZSB7fTsKICAgIAogICAgdGVtcGxhdGUgPGNsYXNzIFQ+CiAgICBzdHJ1Y3Qgc2FtZXR5cGU8VCxUPiB7dHlwZWRlZiBpbnQgc2FtZTt9OwogICAgCiAgICBpbnQgbWFpbigpIHsKICAgIGludCAmcmVmaW50KCk7CiAgICBzdGQ6OnN0cmluZyBzdHIoKTsKICAgIHN0ZDo6c3RyaW5nIGNvbnN0IGNvbnN0c3RyKCk7CgogICAgYXV0byBpMSA9IDE7IC8vIGRlZHVjZSgxKSBnaXZlcyBUPWludCBzbyBpbnQgaTEKICAgIGF1dG8gaTIgPSBpMTsgLy8gZGVkdWNlKGkxKSBnaXZlcyBUPWludCBzbyBpbnQgaTIKICAgIGF1dG8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