summaryrefslogtreecommitdiff
path: root/tests/headers/deleted-function.hpp
blob: 61848a0ae93ac12ea847837d56b36625287efb36 (plain)
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
35
// bindgen-flags: --generate-inline-functions -- -std=c++11

class A {
public:
      // Deleted function should not get a binding.
      void deleted() = delete;

      // Inline functions should get bindings, whether they are defined inline
      // (in the class) or out of line.
      inline void inline_definition() {}
      inline void out_of_line_definition();

      // TODO: This is an edge case that we get wrong: An inline function
      // without a definition in the same translation unit should still get a
      // binding. We currently can't distinguish this case from a deleted member
      // function because libclang doesn't provide a direct way to query for
      // deleted member functions. This seems acceptable, however, as an inline
      // function without a definition in the same translation unit is unlikely
      // to be useful in practice.
      inline void inline_without_definition();
};

void A::out_of_line_definition() {}

class B {
public:
     // Deleted copy constructor should not get a binding.
     B(B&) = delete;
};

class C {
public:
     // Defaulted copy constructor should get a binding.
     C(C&) = default;
};