mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
41 lines
353 B
C++
41 lines
353 B
C++
|
|
enum Type { S, I };
|
|
|
|
struct Entry {
|
|
|
|
char* name;
|
|
Type t;
|
|
char* s;
|
|
int i;
|
|
|
|
};
|
|
|
|
union Value {
|
|
char* s;
|
|
int i;
|
|
};
|
|
|
|
|
|
struct EntryWithMethod: Entry {
|
|
int getAsInt() {
|
|
return i;
|
|
}
|
|
};
|
|
|
|
void myFunction()
|
|
{
|
|
union MyLocalUnion {
|
|
int i;
|
|
float f;
|
|
};
|
|
}
|
|
|
|
class MyClass
|
|
{
|
|
public:
|
|
union MyNestedUnion {
|
|
int i;
|
|
float f;
|
|
};
|
|
};
|