Skip to content

Commit 99c78ce

Browse files
committed
Fix hints for unnamed
1 parent ee08d8c commit 99c78ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang-tools-extra/clangd/InlayHints.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> {
738738
private:
739739
using NameVec = SmallVector<StringRef, 8>;
740740

741-
void processCall(Callee Callee, SourceRange LParenOrBraceRange,
741+
void processCall(Callee Callee, SourceRange RParenOrBraceRange,
742742
llvm::ArrayRef<const Expr *> Args) {
743743
assert(Callee.Decl || Callee.Loc);
744744

@@ -795,7 +795,7 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> {
795795
CharSourceRange::getTokenRange(Params[I]->getDefaultArgRange()),
796796
AST.getSourceManager(), AST.getLangOpts());
797797
FormattedDefaultArgs.emplace_back(llvm::formatv(
798-
"{0}: {1}", Name,
798+
"{0}: {1}", Name.empty() ? "/*unused*/" : Name,
799799
SourceText.size() > Cfg.InlayHints.TypeNameLimit ? "..."
800800
: SourceText));
801801
}
@@ -811,7 +811,7 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> {
811811
std::string Hint =
812812
joinAndTruncate(FormattedDefaultArgs, Cfg.InlayHints.TypeNameLimit,
813813
[](const auto &E) { return E; });
814-
addInlayHint(LParenOrBraceRange, HintSide::Left,
814+
addInlayHint(RParenOrBraceRange, HintSide::Left,
815815
InlayHintKind::DefaultArgument,
816816
HasNonDefaultArgs ? ", " : "", Hint, "");
817817
}

0 commit comments

Comments
 (0)