mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
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.
30 lines
706 B
C++
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;
|