Home | History | Annotate | Download | only in temp.deduct.conv
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 struct AnyPtr {
      3   template<typename T>
      4   operator T*() const;
      5 };
      6 
      7 // If A is a cv-qualified type, the top level cv-qualifiers of A's type
      8 // are ignored for type deduction.
      9 void test_cvquals(AnyPtr ap) {
     10   int* const ip = ap;
     11   const float * const volatile fp = ap;
     12 }
     13 
     14 // If A is a reference type, the type referred to by A is used for
     15 // type deduction.
     16 void test_ref_arg(AnyPtr ap) {
     17   const int* const &ip = ap;
     18   double * const &dp = ap;
     19 }
     20 
     21 struct AnyRef {
     22   template<typename T>
     23   operator T&() const;
     24 };
     25 
     26 void test_ref_param(AnyRef ar) {
     27   int &ir = ar;
     28   const float &fr = ar;
     29   int i = ar;
     30 }
     31