summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-11-15 14:52:04 +0100
committerSam McCall <sam.mccall@gmail.com>2019-11-15 15:42:18 +0100
commitfa3b87fbeb465c7ff9fd3c24b168d534d380af16 (patch)
treef79abff6ae5103d0dc0642902255d336545e1c66 /clang/lib/Sema/SemaCodeComplete.cpp
parentb0c1900820c3f0a94e3c74e6dcb1317b9cda5af8 (diff)
downloadbcm5719-llvm-fa3b87fbeb465c7ff9fd3c24b168d534d380af16.tar.gz
bcm5719-llvm-fa3b87fbeb465c7ff9fd3c24b168d534d380af16.zip
[CodeComplete] Constructor overload candidates report as vector(int) instead of vector<string>(int)
Summary: This is shorter, shouldn't be confusing (is consistent with how they're declared), and avoids messy cases that are printed as myclass<type-param-0-0>(int) in the case of partial specialization. Fixes part of https://github.com/clangd/clangd/issues/76 Reviewers: hokein, lh123 Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70307
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index e4c4264d9dc..ade6e46d1bc 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -3653,6 +3653,10 @@ CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(
unsigned CurrentArg, Sema &S, CodeCompletionAllocator &Allocator,
CodeCompletionTUInfo &CCTUInfo, bool IncludeBriefComments) const {
PrintingPolicy Policy = getCompletionPrintingPolicy(S);
+ // Show signatures of constructors as they are declared:
+ // vector(int n) rather than vector<string>(int n)
+ // This is less noisy without being less clear, and avoids tricky cases.
+ Policy.SuppressTemplateArgsInCXXConstructors = true;
// FIXME: Set priority, availability appropriately.
CodeCompletionBuilder Result(Allocator, CCTUInfo, 1,
OpenPOWER on IntegriCloud