[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / SemaCXX / ptrtomember-overload-resolution.cpp
blob85ed0aaa4f9e2181c8cc5b040218bdae2661450c
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
2 // expected-no-diagnostics
4 // 13.3.3.2 Ranking implicit conversion sequences
5 // conversion of A::* to B::* is better than conversion of A::* to C::*,
6 struct A {
7 int Ai;
8 };
10 struct B : public A {};
11 struct C : public B {};
13 const char * f(int C::*){ return ""; }
14 int f(int B::*) { return 1; }
16 struct D : public C {};
18 const char * g(int B::*){ return ""; }
19 int g(int D::*) { return 1; }
21 void test()
23 int i = f(&A::Ai);
25 const char * str = g(&A::Ai);
28 // conversion of B::* to C::* is better than conversion of A::* to C::*
29 typedef void (A::*pmfa)();
30 typedef void (B::*pmfb)();
31 typedef void (C::*pmfc)();
33 struct X {
34 operator pmfa();
35 operator pmfb();
39 void g(pmfc);
41 void test2(X x)
43 g(x);