r226908 - Sema: code completion for variadic prototypes.

Francisco Lopes da Silva oblita at gmail.com
Fri Jan 23 05:17:52 PST 2015


Author: francisco.lopes
Date: Fri Jan 23 07:17:51 2015
New Revision: 226908

URL: http://llvm.org/viewvc/llvm-project?rev=226908&view=rev
Log:
Sema: code completion for variadic prototypes.

Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=226908&r1=226907&r2=226908&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Fri Jan 23 07:17:51 2015
@@ -3966,9 +3966,11 @@ void Sema::CodeCompleteCall(Scope *S, Ex
 
       if (auto FP = T->getAs<FunctionProtoType>()) {
         if (!TooManyArguments(FP->getNumParams(), Args.size(),
-                             /*PartialOverloading=*/true))
+                             /*PartialOverloading=*/true) ||
+            FP->isVariadic())
           Results.push_back(ResultCandidate(FP));
       } else if (auto FT = T->getAs<FunctionType>())
+        // No prototype and declaration, it may be a K & R style function.
         Results.push_back(ResultCandidate(FT));
     }
   }





More information about the cfe-commits mailing list