[PATCH] D62582: [CodeComplete] Improve overload handling for C++ qualified and ref-qualified methods.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 08:50:09 PDT 2019


ilya-biryukov added inline comments.


================
Comment at: lib/Sema/SemaCodeComplete.cpp:1300
+        auto &OverloadSet =
+            OverloadMap[std::make_pair(CurContext, Method->getName())];
+        for (const DeclIndexPair& Entry : OverloadSet) {
----------------
Won't this crash on `Method->getName()`? Could we add a test for that?
Completing in a class that has a user-defined `operator==()` would probably do the trick.


================
Comment at: lib/Sema/SemaCodeComplete.cpp:1308
+            // should remove all. But two overloads is by far the common case.
+            Incumbent = std::move(R);
+            return;
----------------
Could you add a comment that we modify previously added results here?
It's obvious from the code, but not something I would normally expect so having a separate comment looks useful.


Repository:
  rC Clang

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

https://reviews.llvm.org/D62582





More information about the cfe-commits mailing list