-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No completions offered after (*this).
in template class
#1952
Closed
Labels
bug
Something isn't working
Comments
This seems to be enough to fix it: diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index c44be0df9b0a..0e44b0f444ed 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -20,6 +20,7 @@
#include "clang/AST/ExprConcepts.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/NestedNameSpecifier.h"
+#include "clang/AST/OperationKinds.h"
#include "clang/AST/QualTypeNames.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Type.h"
@@ -5674,6 +5675,11 @@ QualType getApproximateType(const Expr *E) {
return getApproximateType(VD->getInit());
}
}
+ if (const auto *UO = llvm::dyn_cast<UnaryOperator>(E)) {
+ if (UO->getOpcode() == UnaryOperatorKind::UO_Deref) {
+ return UO->getSubExpr()->getType()->getPointeeType();
+ }
+ }
return Unresolved;
} |
HighCommander4
added a commit
to HighCommander4/llvm-project
that referenced
this issue
Mar 25, 2024
This allows completing after `(*this).` in a dependent context. Fixes clangd/clangd#1952
I put the fix + a test up at llvm/llvm-project#86466 |
HighCommander4
added a commit
to HighCommander4/llvm-project
that referenced
this issue
Mar 26, 2024
This allows completing after `(*this).` in a dependent context. Fixes clangd/clangd#1952
HighCommander4
added a commit
to llvm/llvm-project
that referenced
this issue
Mar 26, 2024
…6466) This allows completing after `(*this).` in a dependent context. Fixes clangd/clangd#1952
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the following code:
code completion at the
^
does not offer members of the class.It works with
this->
and in non-template classes.The text was updated successfully, but these errors were encountered: