https://github.com/HighCommander4 requested changes to this pull request.
This patch causes clangd to infinite loop on the following example, when
invoked on the primary definition of `Even`:
```c++
template <int>
struct Even;
template <int>
struct Odd;
template <>
struct Even<0> {
static const bool value = true;
};
template <>
struct Odd<0> {
static const bool value = false;
};
template <int I>
struct Even : Odd<I - 1> {};
template <int I>
struct Odd : Even<I - 1> {};
constexpr bool Answer = Even<42>::value;
```
To avoid situations like this, I would suggest maintain a set of "seen"
`SymbolID`s and only adding an ID to `RecursiveSearch` if it isn't already seen.
(As usual, let's also add the above testcase to the test suite.)
https://github.com/llvm/llvm-project/pull/177564
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits