[PATCH] D36390: Fix overloaded static functions in SemaCodeComplete

Benjamin Kramer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 07:01:19 PDT 2017


bkramer added inline comments.


================
Comment at: include/clang/Sema/Sema.h:2681
+                      bool PartialOverloading = false,
+                      bool ExtraFirstArgument = false);
   void AddMethodCandidate(DeclAccessPair FoundDecl,
----------------
I'd prefer something like "FirstArgumentIsBase"


================
Comment at: lib/Sema/SemaOverload.cpp:5871
       // is irrelevant.
+
       AddMethodCandidate(Method, FoundDecl, Method->getParent(), QualType(),
----------------
Unnecessary whitespace change.


================
Comment at: lib/Sema/SemaOverload.cpp:6339
       } else {
+        // Slice the first argument when we access static method as non-static
+        if (Args.size() > 0 && ExtraFirstArgument && isa<CXXMethodDecl>(FD)
----------------
Add a comment that the first argument is the base.


================
Comment at: lib/Sema/SemaOverload.cpp:6341
+        if (Args.size() > 0 && ExtraFirstArgument && isa<CXXMethodDecl>(FD)
+                && !isa<CXXConstructorDecl>(FD)) {
+          Args = Args.slice(1);
----------------
clang-format


================
Comment at: lib/Sema/SemaOverload.cpp:6342
+                && !isa<CXXConstructorDecl>(FD)) {
+          Args = Args.slice(1);
+        }
----------------
assert that FD is a static method.


https://reviews.llvm.org/D36390





More information about the cfe-commits mailing list