Files
codeql/cpp/ql/test/library-tests/unions/unions.cpp
2019-08-06 16:00:35 +01:00

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;
};
};