aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/converting-constructor.cpp
blob: b99a134328efcda565487ddc531a7b26372169f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: clang -fsyntax-only -verify %s 
class Z { };

class Y { 
public:
  Y(const Z&);
};

class X {
public:
  X(int);
  X(const Y&);
};

void f(X);

void g(short s, Y y, Z z) {
  f(s);
  f(1.0f);
  f(y);
  f(z); // expected-error{{incompatible type passing 'class Z', expected 'class X'}}
}