| 22 | //----------------------------------------------------------------------------- |
| 23 | |
| 24 | void OutputFormatHelper::AppendParameterList(const ArrayRef<ParmVarDecl*> parameters, |
| 25 | const NameOnly nameOnly, |
| 26 | const GenMissingParamName genMissingParamName) |
| 27 | { |
| 28 | int count{}; |
| 29 | |
| 30 | ForEachArg(parameters, [&](const auto& p) { |
| 31 | auto name{GetName(*p)}; |
| 32 | |
| 33 | // A special case for CXXInheritedCtor. A user can omit the parameters name, but wihtout a name the call to the |
| 34 | // base constructor may look like calling the default constructor. In such a case we create a name. |
| 35 | if((GenMissingParamName::Yes == genMissingParamName) && (0 == name.length())) { |
| 36 | name = BuildInternalVarName(StrCat("param", count)); |
| 37 | ++count; |
| 38 | } |
| 39 | |
| 40 | // Get the attributes and insert them, if there are any |
| 41 | CodeGeneratorVariant codeGenerator{*this}; |
| 42 | codeGenerator->InsertAttributes(p->attrs()); |
| 43 | |
| 44 | if(const auto type{GetType(p->getType())}; NameOnly::No == nameOnly) { |
| 45 | |
| 46 | Append(GetTypeNameAsParameter(type, name)); |
| 47 | } else { |
| 48 | Append(name); |
| 49 | |
| 50 | if(isa<PackExpansionType>(type)) { |
| 51 | Append(kwElipsis); |
| 52 | } |
| 53 | } |
| 54 | }); |
| 55 | } |
| 56 | //----------------------------------------------------------------------------- |
| 57 | |
| 58 | void OutputFormatHelper::CloseScope(const NoNewLineBefore newLineBefore) |
no test coverage detected