Issue 123549
Summary HeuristicResolver::getPointeeType discards qualifiers
Labels clangd, clang:frontend
Assignees HighCommander4
Reporter HighCommander4
    `HeuristicResolver::getPointeeType()` returns a `Type *` rather than a `QualType`, which means it necessarily discards any qualifiers on the returned pointee type.

This can be important, as seen e.g. in clangd in the following code:

```c++
template <typename T>
struct Waldo {
  void find();
  void find() const;
};

template <typename T>
struct smart_ptr {
  T* operator->();
};

template <typename T>
void foo(smart_ptr<const Waldo<T>> s) {
  s->find();
}
```

Go-to-definition on the `find` token in `s->find()` offers both overloads of `Waldo::find()` as results, when it should only offer the `const` overload.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to