18fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
29a657934SDouglas Gregor int* quals1(int const * p);
39a657934SDouglas Gregor int* quals2(int const * const * pp);
4e254f90dSDouglas Gregor int* quals3(int const * * const * ppp); // expected-note{{candidate function}}
59a657934SDouglas Gregor 
test_quals(int * p,int ** pp,int *** ppp)69a657934SDouglas Gregor void test_quals(int * p, int * * pp, int * * * ppp) {
79a657934SDouglas Gregor   int const * const * pp2 = pp;
89a657934SDouglas Gregor   quals1(p);
99a657934SDouglas Gregor   quals2(pp);
10e254f90dSDouglas Gregor   quals3(ppp); // expected-error {{no matching}}
119a657934SDouglas Gregor }
1272b597d6SSebastian Redl 
1372b597d6SSebastian Redl struct A {};
1472b597d6SSebastian Redl void mquals1(int const A::*p);
1572b597d6SSebastian Redl void mquals2(int const A::* const A::*pp);
16e254f90dSDouglas Gregor void mquals3(int const A::* A::* const A::*ppp);  // expected-note{{candidate function}}
1772b597d6SSebastian Redl 
test_mquals(int A::* p,int A::* A::* pp,int A::* A::* A::* ppp)1872b597d6SSebastian Redl void test_mquals(int A::*p, int A::* A::*pp, int A::* A::* A::*ppp) {
1972b597d6SSebastian Redl   int const A::* const A::* pp2 = pp;
2072b597d6SSebastian Redl   mquals1(p);
2172b597d6SSebastian Redl   mquals2(pp);
22e254f90dSDouglas Gregor   mquals3(ppp); // expected-error {{no matching}}
2372b597d6SSebastian Redl }
24*607f38e0SChandler Carruth 
25*607f38e0SChandler Carruth void aquals1(int const (*p)[1]);
26*607f38e0SChandler Carruth void aquals2(int * const (*pp)[1]);
27*607f38e0SChandler Carruth void aquals2a(int const * (*pp2)[1]); // expected-note{{candidate function}}
28*607f38e0SChandler Carruth 
test_aquals(int (* p)[1],int * (* pp)[1],int * (* pp2)[1])29*607f38e0SChandler Carruth void test_aquals(int (*p)[1], int * (*pp)[1], int * (*pp2)[1]) {
30*607f38e0SChandler Carruth   int const (*p2)[1] = p;
31*607f38e0SChandler Carruth   aquals1(p);
32*607f38e0SChandler Carruth   aquals2(pp);
33*607f38e0SChandler Carruth   aquals2a(pp2); // expected-error {{no matching}}
34*607f38e0SChandler Carruth }
35