File: qualification-conversion.cpp

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (34 lines) | stat: -rw-r--r-- 1,053 bytes parent folder | download | duplicates (39)
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
31
32
33
34
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s 
int* quals1(int const * p);
int* quals2(int const * const * pp);
int* quals3(int const * * const * ppp); // expected-note{{candidate function}}

void test_quals(int * p, int * * pp, int * * * ppp) {
  int const * const * pp2 = pp; 
  quals1(p);
  quals2(pp);
  quals3(ppp); // expected-error {{no matching}}
}

struct A {};
void mquals1(int const A::*p);
void mquals2(int const A::* const A::*pp);
void mquals3(int const A::* A::* const A::*ppp);  // expected-note{{candidate function}}

void test_mquals(int A::*p, int A::* A::*pp, int A::* A::* A::*ppp) {
  int const A::* const A::* pp2 = pp;
  mquals1(p);
  mquals2(pp);
  mquals3(ppp); // expected-error {{no matching}}
}

void aquals1(int const (*p)[1]);
void aquals2(int * const (*pp)[1]);
void aquals2a(int const * (*pp2)[1]); // expected-note{{candidate function}}

void test_aquals(int (*p)[1], int * (*pp)[1], int * (*pp2)[1]) {
  int const (*p2)[1] = p;
  aquals1(p);
  aquals2(pp);
  aquals2a(pp2); // expected-error {{no matching}}
}