summaryrefslogtreecommitdiffstats
path: root/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p3.cpp
blob: 95bd7fe121595d9f013b8b0a50d84b3608b8e591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: clang-cc -fsyntax-only -verify %s
struct AnyPtr {
  template<typename T>
  operator T*() const;
};

// If A is a cv-qualified type, the top level cv-qualifiers of A's type
// are ignored for type deduction.
void test_cvquals(AnyPtr ap) {
  int* const ip = ap;
  const float * const volatile fp = ap;
}

// If A is a reference type, the type referred to by A is used for
// type deduction.
void test_ref_arg(AnyPtr ap) {
  const int* const &ip = ap;
  double * const &dp = ap;
}

struct AnyRef {
  template<typename T>
  operator T&() const;
};

void test_ref_param(AnyRef ar) {
  int &ir = ar;
  const float &fr = ar;
  int i = ar;
}