[PATCH] Implementation for completion in call context for C++

Manuel Klimek klimek at google.com
Wed Jan 21 05:13:41 PST 2015


Ok, looks good now. Thanks! This is a really nice improvement.


================
Comment at: lib/Sema/SemaCodeComplete.cpp:3893-3896
@@ +3892,6 @@
+  else if (auto UME = dyn_cast<UnresolvedMemberExpr>(NakedFn)) {
+    TemplateArgumentListInfo TemplateArgsBuffer, *TemplateArgs = nullptr;
+    if (UME->hasExplicitTemplateArgs()) {
+      UME->copyTemplateArgumentsInto(TemplateArgsBuffer);
+      TemplateArgs = &TemplateArgsBuffer;
+    }
----------------
francisco.lopes wrote:
> klimek wrote:
> > I now understand the need for copying, but not why you need an extra variable for the pointer instead of just passing &TemplateArgsBuffer below.
> There's a convention in the codebase that a parameter of type `TemplateArgumentListInfo *`, for explicit template arguments, may be checked for `nullptr` by the callee. Also, this snippet follows a pattern used elsewhere in the codebase.
/me headdesks; (the reason is that we only have it if UME->hasExplicitTemplateArgs(), I completely missed that).

http://reviews.llvm.org/D6880

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list