1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2// expected-no-diagnostics
3
4// Deductions specific to C++0x.
5
6template<typename T>
7struct member_pointer_kind {
8  static const unsigned value = 0;
9};
10
11template<class C, typename R, typename ...Args>
12struct member_pointer_kind<R (C::*)(Args...)> {
13  static const unsigned value = 1;
14};
15
16template<class C, typename R, typename ...Args>
17struct member_pointer_kind<R (C::*)(Args...) &> {
18  static const unsigned value = 2;
19};
20
21template<class C, typename R, typename ...Args>
22struct member_pointer_kind<R (C::*)(Args...) &&> {
23  static const unsigned value = 3;
24};
25
26template<class C, typename R, typename ...Args>
27struct member_pointer_kind<R (C::*)(Args...) const> {
28  static const unsigned value = 4;
29};
30
31template<class C, typename R, typename ...Args>
32struct member_pointer_kind<R (C::*)(Args...) const &> {
33  static const unsigned value = 5;
34};
35
36template<class C, typename R, typename ...Args>
37struct member_pointer_kind<R (C::*)(Args...) const &&> {
38  static const unsigned value = 6;
39};
40
41struct X { };
42
43static_assert(member_pointer_kind<int (X::*)(int)>::value == 1, "");
44static_assert(member_pointer_kind<int (X::*)(int) &>::value == 2, "");
45static_assert(member_pointer_kind<int (X::*)(int) &&>::value == 3, "");
46static_assert(member_pointer_kind<int (X::*)(int) const>::value == 4, "");
47static_assert(member_pointer_kind<int (X::*)(int) const&>::value == 5, "");
48static_assert(member_pointer_kind<int (X::*)(int) const&&>::value == 6, "");
49