// DR 1512 // Test the composite pointer type of two operands. // { dg-do compile { target c++11 } } using nullptr_t = decltype(nullptr); template struct same; template struct same { }; template T fn () { } // Check that the composite pointer type of T and U is RES. template void test () { same() : fn()), RES> s; } struct A { }; struct B : A { }; // Test [expr.type]/3. void foo () { // if both p1 and p2 are null pointer constants -> std::nullptr_­t. test(); // if either p1 or p2 is a null pointer constant -> T2 or T1. test(); test(); // if T1 or T2 is 'pointer to cv1 void' and the other type is 'pointer // to cv2 T', where T is an object type or void -> 'pointer to cv12 void', // where cv12 is the union of cv1 and cv2. test(); test(); test(); // Make sure that we propagate 'const' here as per [conv.qual]/3.3. test(); test(); test(); // if T1 is 'pointer to cv1 C1' and T2 is 'pointer to cv2 C2', where C1 is // reference-related to C2 or C2 is reference-related to C1 -> the cv-combined // type of T1 and T2 or the cv-combined type of T2 and T1, respectively. test(); test(); test(); // FIXME: This doesn't work if they're reference-related but not same. //test(); //test(); // if T1 or T2 is 'pointer to noexcept function' and the other type is // 'pointer to function', where the function types are otherwise the same // -> 'pointer to function'. test(); test(); // if T1 or T2 is 'pointer to member of C1 of type function', the other type // is 'pointer to member of C2 of type noexcept function', and C1 is // reference-related to C2 or C2 is reference-related to C1, where the // function types are otherwise the same -> 'pointer to member of C2 of type // function' or 'pointer to member of C1 of type function', respectively. test(); test(); }