p4.cpp revision 65ec1fda479688d143fe2403242cd9c730c800a1
1// RUN: clang-cc -fsyntax-only %s 2 3struct AnyT { 4 template<typename T> 5 operator T(); 6}; 7 8void test_cvqual_ref(AnyT any) { 9 const int &cir = any; 10} 11 12struct AnyThreeLevelPtr { 13 template<typename T> 14 operator T***() const; 15 // FIXME: Can't handle definitions of member templates yet 16#if 0 17 { 18 T x = 0; 19 x = 0; // will fail if T is deduced to a const type 20 // (EDG and GCC get this wrong) 21 return 0; 22 } 23#endif 24}; 25 26void test_deduce_with_qual(AnyThreeLevelPtr a3) { 27 int * const * const * const ip = a3; 28} 29 30struct X { }; 31 32struct AnyPtrMem { 33 template<typename Class, typename T> 34 operator T Class::*() const; 35 // FIXME: Can't handle definitions of member templates yet 36#if 0 37 { 38 T x = 0; 39 x = 0; // will fail if T is deduced to a const type. 40 // (EDG and GCC get this wrong) 41 return 0; 42 } 43#endif 44}; 45 46void test_deduce_ptrmem_with_qual(AnyPtrMem apm) { 47 const float X::* pm = apm; 48} 49