aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cast-conversion.cpp
blob: cbc24aef28d587ea44aa08d56088d908efc67b6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x

struct R {
  R(int);
};

struct A {
  A(R);
};

struct B {
  B(A);
};

int main () {
  B(10);	// expected-error {{functional-style cast from 'int' to 'struct B' is not allowed}}
  (B)10;	// expected-error {{C-style cast from 'int' to 'struct B' is not allowed}}
  static_cast<B>(10);	// expected-error {{static_cast from 'int' to 'struct B' is not allowed}} \\
			// expected-warning {{expression result unused}}
}