Issue 166741
Summary [clangd] Incorrect completion for non-static member function with qualified-id
Labels new issue
Assignees
Reporter etyloppihacilem
    When completing after a qualified-id that cannot introduce a definition, clangd suggests non-static member functions, even though they are never valid in this context.

## Example

```cpp
struct A {
  void f();
  static void g();
};

void foo() {
  A::^
}
```
## Actual behavior

clangd suggests both `A::f` and `A::g`.

## Expected behavior

Only static members `A::g` should be suggested, since `A::f` cannot be referred to without an object (and this context cannot introduce a definition).

## Notes

In contexts where a definition is possible (e.g. outside of any function body), completing `A::` should continue to offer both static and non-static member functions, since you might be defining `A::f`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to