klimek added a comment. Ok, now I get it - can you please add tests? This is usually tested by adding a c-index-test based test.
================ Comment at: lib/Sema/SemaCodeComplete.cpp:2411-2417 + const SourceLocation StartLoc = SrcRange.getBegin(); + const SourceLocation EndLoc = SrcRange.getEnd(); + if (StartLoc != SM.getExpansionLoc(StartLoc) || EndLoc != SM.getExpansionLoc(EndLoc)) + return ""; + const size_t PtrDiff = EndLoc.getRawEncoding() - StartLoc.getRawEncoding() + + Lexer::MeasureTokenLength(EndLoc, SM, LangOpts); + return std::string{SM.getCharacterData(StartLoc), PtrDiff}; ---------------- Can you use Lexer::getSourceText instead? ================ Comment at: lib/Sema/SemaCodeComplete.cpp:2453 std::string PlaceholderStr = FormatFunctionParameter(Policy, Param); + if (Param->hasDefaultArg() && PlaceholderStr.find("=") == std::string::npos) { + std::string DefaultValue = ---------------- Why the check for = in the PlaceholderStr? https://reviews.llvm.org/D33644 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits