summaryrefslogtreecommitdiff
path: root/Utilities/ClangTidyModule/Tests/cmake-use-cmsys-fstream-fixit.cxx
blob: 5c7c12323f84c082ccebe86c51ab6a843201c643 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <fstream>
#include <vector>

namespace cmsys {
using std::ifstream;
using std::ofstream;
using std::fstream;
}

namespace ns {
using std::ifstream;
using std::ofstream;
using std::fstream;

namespace ns {
using std::ifstream;
using std::ofstream;
using std::fstream;
}

class cl
{
public:
  using ifstream = cmsys::ifstream;
  using ofstream = cmsys::ofstream;
  using fstream = cmsys::fstream;
};

using ifs = cmsys::ifstream;
using ofs = cmsys::ofstream;
using fs = cmsys::fstream;
}

int main()
{
  using std::ifstream;
  using std::ofstream;
  using std::fstream;

  // Correction needed
  cmsys::ifstream ifsUnqual;
  cmsys::ifstream ifsQual;
  cmsys::ifstream ifsNS;
  cmsys::ifstream ifsNested;
  cmsys::ifstream ifsClass;
  cmsys::ifstream ifsRenamed;

  cmsys::ofstream ofsUnqual;
  cmsys::ofstream ofsQual;
  cmsys::ofstream ofsNS;
  cmsys::ofstream ofsNested;
  cmsys::ofstream ofsClass;
  cmsys::ofstream ofsRenamed;

  cmsys::fstream fsUnqual;
  cmsys::fstream fsQual;
  cmsys::fstream fsNS;
  cmsys::fstream fsNested;
  cmsys::fstream fsClass;
  cmsys::fstream fsRenamed;

  cmsys::ifstream::off_type offsetQual = 0;
  cmsys::ifstream::off_type offsetUnqual = 0;
  cmsys::ifstream::off_type offsetNS = 0;
  cmsys::ifstream::off_type offsetNested = 0;
  cmsys::ifstream::traits_type::off_type offsetTraitsNested = 0;
  cmsys::ifstream::traits_type::off_type offsetTraitsClass = 0;

  std::vector<cmsys::ifstream> ifsVectorUnqual;

  // No correction needed
  cmsys::ifstream ifsCmsys;
  cmsys::ofstream ofsCmsys;
  cmsys::fstream fsCmsys;
  cmsys::ifstream::off_type offsetCmsys = 0;
  cmsys::ifstream::traits_type::off_type offsetTraitsCmsys = 0;
  std::vector<cmsys::ifstream> ifsVectorCmsys;
  std::basic_ifstream<wchar_t> ifsWchar;

  return 0;
}