p3.cpp revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2struct 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.
9void 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.
16void test_ref_arg(AnyPtr ap) {
17  const int* const &ip = ap;
18  double * const &dp = ap;
19}
20
21struct AnyRef {
22  template<typename T>
23  operator T&() const;
24};
25
26void test_ref_param(AnyRef ar) {
27  int &ir = ar;
28  const float &fr = ar;
29  int i = ar;
30}
31