Files
codeql/cpp/ql/test/library-tests/structs/qualified_names/defs.cpp
Jonas Jensen b633ee1bc4 C++: Add more tests of resolveClass
These tests exercise the problematic cases where a variable can appear
to have multiple types because of how we fail to account for qualified
names when comparing type names.
2018-09-17 15:48:02 +02:00

30 lines
706 B
C++

namespace foo {
class C {
};
}
namespace bar {
class C {
};
}
class DefinedAndDeclared {
};
// Despite this declaration being present, the variable below is associated
// with the definition above rather than this declaration.
class DefinedAndDeclared;
DefinedAndDeclared *definedAndDeclared;
#include "header.h"
// Because there are multiple definitions of `MultipleDefsButSameHeader`, the
// type of this variable will refer to the declaration in `header.h` rather
// than any of the definitions.
MultipleDefsButSameHeader *mdbsh;
// Because there is only one definition of `OneDefInDifferentFile`, the type of
// this variable will refer to that definition.
OneDefInDifferentFile *odidf;