[PATCH] D71966: [Wdocumentation][RFC] Improve identifier's of \param

Mark de Wever via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 16 09:06:10 PST 2020


Mordante planned changes to this revision.
Mordante marked an inline comment as done.
Mordante added inline comments.


================
Comment at: clang/lib/AST/CommentSema.cpp:1121
+  if (isFunctionOrMethodVariadic() &&
+      Typo.find_first_not_of('.') == StringRef::npos)
+    return ParamCommandComment::VarArgParamIndex;
----------------
Mordante wrote:
> gribozavr2 wrote:
> > I'm not sure I like the heuristic.
> > 
> > ```
> > // \param foo.bar Something.
> > void foo(int foo_bar, ...);
> > ```
> > 
> > Here we would suggest to correct `foo.bar` to `...`.
> > 
> > Instead, I'd suggest to throw a "..." identifier into the typo corrector if the function is variadic, and let the edit distance decide.
> This heuristic works at the moment. The `lexIdentifier` will not accept `foo.bar`. However since you requested to remove the `lexIdentifier` your approach makes more sense.
Any suggestion how to do this? The `SimpleTypoCorrector` expects a `NamedDecl`, but AFAIK `...` isn't a `NamedDecl`.


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

https://reviews.llvm.org/D71966





More information about the cfe-commits mailing list