Files
codeql/cpp/ql/test/library-tests/variables/global
Jeroen Ketema 82c9b8b494 C++: Ensure only one Variable exists for every global variable
Depending on the extraction order, before this change there might be multiple
`GlobalVariable`s per declared global variable. See the tests in
`cpp/ql/test/library-tests/variables/global`. This change ensures that only one
of those `GlobalVariable`s is visible to the user if we can locate a unique
definition. If not, the old situation persists.

Note that an exception needs to be made for templated variables. Here, the
definition refers to the non-instantiated template, while a declaration that
is not a definition refers to an instantiation. In case the instantiation refers
to a template parameter, the mangled names of the template and the instantiation
will be identical. This happens for example in the following case:
```
template <typename T>
T x = T(42);           // Uninstantiated templated variable

template <typename T>
class C {
  T y = x<T>;          // Instantiation using a template parameter
};
```
Since the uninstantiated template and the instantiation are two different
entities, we do not unify them as described above.
2022-06-28 15:32:43 +02:00
..
2022-06-21 10:43:40 +02:00
2022-06-21 10:43:40 +02:00
2022-06-21 10:43:40 +02:00
2022-06-22 07:56:27 +02:00
2022-06-22 07:56:27 +02:00
2022-06-22 07:56:27 +02:00
2019-09-09 11:25:53 +02:00