Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

Investigate extracting parameter names from comments

Open PathogenDavid opened this issue 3 years ago • 1 comments

To avoid unused parameter warnings, C++ developers sometimes leave parameters unnamed and put the name in a comment, for example:

virtual void attachToContext(cudnnContext* /*cudnn*/, cublasContext* /*cublas*/, IGpuAllocator* /*allocator*/) TRTNOEXCEPT {}

It might be nice if we could find the commented name and surface it somehow. Unfortunately Clang's comment-to-declaration association logic does not attach these comments to the ParmVarDecl declarations, so we can't rely on that.

PathogenDavid avatar Nov 07 '20 10:11 PathogenDavid

The newly added AutoNameUnnamedParametersTransformation makes this situation slightly less obnoxious. I do still want to investigate whether Clang automagically associates these comments with the parameter or not. (Maybe at the same time as https://github.com/InfectedLibraries/Biohazrd/issues/20)

PathogenDavid avatar Feb 22 '21 11:02 PathogenDavid