mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
24
cpp/ql/test/library-tests/structs/compatible_cpp/b2.cpp
Normal file
24
cpp/ql/test/library-tests/structs/compatible_cpp/b2.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Definitions of Apple are exactly the same in b1.c and b2.c
|
||||
class AppleCompatible {
|
||||
int apple_x;
|
||||
};
|
||||
|
||||
// Definitions of Banana are compatible but this copy uses a typedef
|
||||
typedef int MyInt;
|
||||
typedef MyInt IntType;
|
||||
class BananaCompatible {
|
||||
IntType banana_x;
|
||||
};
|
||||
|
||||
// Definitions of Cherry are not compatible - the field types differ
|
||||
class Cherry {
|
||||
short cherry_x;
|
||||
};
|
||||
|
||||
// This shows that we currently only consider member variables, and ignore
|
||||
// functions when deciding on class compatibility. In this file there is a
|
||||
// member function called `bar`, in b1.cpp there is one called `foo`.
|
||||
class Damson {
|
||||
int damson_x;
|
||||
void bar();
|
||||
};
|
||||
Reference in New Issue
Block a user