brintos

brintos / llvm-project-archived public Read only

0
0
Text · 671 B · a5916ba Raw
32 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3struct AnyPtr {4  template<typename T>5  operator T*() const;6};7 8// If A is a cv-qualified type, the top level cv-qualifiers of A's type9// are ignored for type deduction.10void test_cvquals(AnyPtr ap) {11  int* const ip = ap;12  const float * const volatile fp = ap;13}14 15// If A is a reference type, the type referred to by A is used for16// type deduction.17void test_ref_arg(AnyPtr ap) {18  const int* const &ip = ap;19  double * const &dp = ap;20}21 22struct AnyRef {23  template<typename T>24  operator T&() const;25};26 27void test_ref_param(AnyRef ar) {28  int &ir = ar;29  const float &fr = ar;30  int i = ar;31}32