Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -pedantic -verify %s |
Douglas Gregor | 98cd599 | 2008-10-21 23:43:52 +0000 | [diff] [blame] | 2 | int* quals1(int const * p); |
| 3 | int* quals2(int const * const * pp); |
Douglas Gregor | fa04764 | 2009-02-04 00:32:51 +0000 | [diff] [blame] | 4 | int* quals3(int const * * const * ppp); // expected-note{{candidate function}} |
Douglas Gregor | 98cd599 | 2008-10-21 23:43:52 +0000 | [diff] [blame] | 5 | |
| 6 | void test_quals(int * p, int * * pp, int * * * ppp) { |
| 7 | int const * const * pp2 = pp; |
| 8 | quals1(p); |
| 9 | quals2(pp); |
Douglas Gregor | fa04764 | 2009-02-04 00:32:51 +0000 | [diff] [blame] | 10 | quals3(ppp); // expected-error {{no matching}} |
Douglas Gregor | 98cd599 | 2008-10-21 23:43:52 +0000 | [diff] [blame] | 11 | } |
Sebastian Redl | 4433aaf | 2009-01-25 19:43:20 +0000 | [diff] [blame] | 12 | |
| 13 | struct A {}; |
| 14 | void mquals1(int const A::*p); |
| 15 | void mquals2(int const A::* const A::*pp); |
Douglas Gregor | fa04764 | 2009-02-04 00:32:51 +0000 | [diff] [blame] | 16 | void mquals3(int const A::* A::* const A::*ppp); // expected-note{{candidate function}} |
Sebastian Redl | 4433aaf | 2009-01-25 19:43:20 +0000 | [diff] [blame] | 17 | |
| 18 | void test_mquals(int A::*p, int A::* A::*pp, int A::* A::* A::*ppp) { |
| 19 | int const A::* const A::* pp2 = pp; |
| 20 | mquals1(p); |
| 21 | mquals2(pp); |
Douglas Gregor | fa04764 | 2009-02-04 00:32:51 +0000 | [diff] [blame] | 22 | mquals3(ppp); // expected-error {{no matching}} |
Sebastian Redl | 4433aaf | 2009-01-25 19:43:20 +0000 | [diff] [blame] | 23 | } |