[PATCH] D39730: Enabling constructor code completion

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 10 10:36:13 PST 2017


arphaman added a comment.

Also,



================
Comment at: lib/Sema/SemaCodeComplete.cpp:980
+  if (isa<CXXConstructorDecl>(R.Declaration)
+      && dyn_cast<NamespaceDecl>(CurContext) == nullptr
+      && dyn_cast<TranslationUnitDecl>(CurContext) == nullptr
----------------
arphaman wrote:
> You can use `!isa<T>`
Have you checked if this check works correctly in cases like this:

```
// main tu
int x = foo::<code-complete>
foo bar;
int x = bar.<code-complete>
```

I suspect the scope will be `TranslationUnitDecl` there as well.



https://reviews.llvm.org/D39730





More information about the cfe-commits mailing list