[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 17 05:40:33 PST 2019


ilya-biryukov added a comment.

Thanks for a quick response, @kadircet!
Leaving some first comments, will address the rest later.

In D56723#1361366 <https://reviews.llvm.org/D56723#1361366>, @kadircet wrote:

> One general comment: I am not really sure if the handling done in `ParseCastExpression` is extensive enough. But IIUC, this should not cause any regressions, rather should result in missing preferred types just as before this patch ?


Exactly, no regressions are expected, we should start providing a preferred type in more places after this change.
This change is aiming to establish a well-defined pattern on how to add these types, more changes will follow to actually propagate the types in more cases.



================
Comment at: lib/Sema/SemaCodeComplete.cpp:360
+  return update([&]() {
+    if (isa<BlockDecl>(S.CurContext)) {
+      if (sema::BlockScopeInfo *BSI = S.getCurBlock())
----------------
kadircet wrote:
> Is this check necessary? According to comments `getCurBlock` returns null if there is no block.
This was copy-pasted from the removed `codeCompleteReturn`. I'd keep it this way in the initial patch to make sure we don't change semantics in existing cases.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56723/new/

https://reviews.llvm.org/D56723





More information about the cfe-commits mailing list