forked from rocwangp/code_snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompiler_function_selection.cpp
More file actions
76 lines (71 loc) · 1.66 KB
/
Copy pathcompiler_function_selection.cpp
File metadata and controls
76 lines (71 loc) · 1.66 KB
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
// Field Selection Error
//// class Snippet {
//// public:
//// double func(double n) {
//// return n;
//// }
//// private:
//// int func(int n) {
//// return n;
//// }
//// };
////
//// int main() {
//// Snippet snippet;
////
//// // XXX:
//// // 1. name selection: func(double) and func(int)
//// // 2. overload selection: func(int)
//// // 3. field selection: func(int) is private, Failed to be accessed
////
//// snippet.func(7);
//// return 0;
//// }
// Overload Selection Error
//// class Snippet {
//// public:
//// double func(double n) {
//// return n;
//// }
//// private:
//// unsigned func(unsigned n) {
//// return n;
//// }
//// };
////
//// int main() {
//// Snippet snippet;
////
//// // XXX:
//// // 1. name selection: func(double n) and func(int)
//// // 2. override selection: failed to select one function
//// snippet.func(7);
//// return 0;
//// }
// Name Selection Error
//// #include <string>
////
//// int func(int n) {
//// return n;
//// }
////
//// class Snippet {
//// public:
//// void test() {
//// func(7);
//// }
//// private:
//// std::string func(std::string n) {
//// return n;
//// }
//// };
////
//// int main() {
//// Snippet snippet;
////
//// // XXX:
//// // 1. name selection: func(std::string). !!! if found one function in current field, do not find again, so global function: func(int) is ignored
//// // 2. override selection: failed to override
//// snippet.test();
//// return 0;
//// }