This is an archive of the discontinued LLVM Phabricator instance.

[CodeComplete] prototype of contextual postfix completions
Needs ReviewPublic

Authored by sammccall on May 9 2022, 5:35 AM.
This revision needs review, but there are no reviewers specified.

Details

Diff Detail

Event Timeline

sammccall created this revision.May 9 2022, 5:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2022, 5:35 AM
sammccall requested review of this revision.May 9 2022, 5:35 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 9 2022, 5:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ilya-biryukov added inline comments.
clang/include/clang/Sema/CodeCompleteConsumer.h
784

NIT: s/he/the

nridge added a subscriber: nridge.May 11 2022, 12:58 AM

Iterator checks may crash in current state. Also, pointeeType may return invalid type of iterator store (T* instead of T)

clang/lib/Sema/SemaCodeComplete.cpp
5589

RD is nullptr here - use RT->getDecl()->getDeclContext() instead

5646

GNU STL use pointer to type in iterators, so need check is Element pointer-to-pointer:

if (Element->isPointerType()) {
  if (const auto *PT = dyn_cast<PointerType>(Element)) {
    Element = PT->getPointeeType();
    if (Element->isPointerType())
      return "const auto*";
  }
}