-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathclass-invis.hpp
108 lines (95 loc) · 2.11 KB
/
class-invis.hpp
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright 2016-2018 The RamFuzz contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/// This is much like class.hpp, except it includes many classes that can't have
/// a harness specialization because they're not visible outside their immediate
/// context. Trying to specialize harness for such classes will result in
/// compilation errors.
class A {
class A2 {
public:
int foo(char) { return 0; }
};
template <typename T> class TA2 {
public:
T foo(char) { return 0; }
};
int sum = 0;
public:
A() { sum |= 0x10; }
int get() const { return sum; }
TA2<double> ta2;
class A3 {
private:
struct A4 {
struct A5 {
class A6 {
public:
int foo(char) { return 1; }
};
template <typename T> class TA6 {
public:
T foo(char) { return 1; }
};
};
};
public:
A4::A5::TA6<float> ta6;
};
class A7 {
public:
const int one() const { return 1; }
};
};
class B {
int sum = 1;
public:
int get() const { return sum; }
void f(A a, const A::A7 &a7) { sum |= a.get() * a7.one(); }
};
namespace NS1 {
namespace NS2 {
namespace {
class C {
public:
void f1(bool) {}
};
template <typename T> class TC {
public:
void f1(T) {}
};
namespace NS3 {
class C2 {
public:
void g1(bool) {}
};
template <typename T> class TC2 {
public:
void g1(T) {}
};
} // namespace NS3
} // anonymous namespace
TC<int> tc;
NS3::TC2<bool> tc2;
} // namespace NS2
} // namespace NS1
inline void f2() {
class D {
public:
void f3(int) {}
};
}
class {
public:
char f4(char c) { return c; }
} e;