<div dir="ltr"><div dir="ltr"><div>Hello Ilya,</div><div><br></div><div>This commit has broken the ABI test builder -<a href="http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/30676" target="_blank"> lab.llvm.org:8011/builders/<wbr>clang-x86_64-linux-abi-test/<wbr>builds/30676</a><br></div><br></div><div dir="ltr">Could you take care of this, please?<br><div><br></div><div>Thanks</div><div><br></div><div><span class="gmail-il">Galina</span><br></div><div><br>. . . <br>
<pre><span class="gmail-m_-231449201681833252gmail-stdout">FAILED: tools/clang/tools/extra/<wbr>unittests/clangd/CMakeFiles/<wbr>ClangdTests.dir/<wbr>CodeCompleteTests.cpp.o 
/usr/bin/c++   -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/extra/<wbr>unittests/clangd -I/home/buildslave/<wbr>buildslave1a/clang-x86_64-<wbr>linux-abi-test/llvm/tools/<wbr>clang/tools/extra/unittests/<wbr>clangd -I/home/buildslave/<wbr>buildslave1a/clang-x86_64-<wbr>linux-abi-test/llvm/tools/<wbr>clang/include -Itools/clang/include -Iinclude -I/home/buildslave/<wbr>buildslave1a/clang-x86_64-<wbr>linux-abi-test/llvm/include -I/home/buildslave/<wbr>buildslave1a/clang-x86_64-<wbr>linux-abi-test/llvm/tools/<wbr>clang/tools/extra/clangd -I/home/buildslave/<wbr>buildslave1a/clang-x86_64-<wbr>linux-abi-test/llvm/utils/<wbr>unittest/googletest/include -I/home/buildslave/<wbr>buildslave1a/clang-x86_64-<wbr>linux-abi-test/llvm/utils/<wbr>unittest/googlemock/include -fPIC -fvisibility-inlines-hidden -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-<wbr>initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3    -UNDEBUG  -Wno-variadic-macros -fno-exceptions -fno-rtti -MD -MT tools/clang/tools/extra/<wbr>unittests/clangd/CMakeFiles/<wbr>ClangdTests.dir/<wbr>CodeCompleteTests.cpp.o -MF tools/clang/tools/extra/<wbr>unittests/clangd/CMakeFiles/<wbr>ClangdTests.dir/<wbr>CodeCompleteTests.cpp.o.d -o tools/clang/tools/extra/<wbr>unittests/clangd/CMakeFiles/<wbr>ClangdTests.dir/<wbr>CodeCompleteTests.cpp.o -c /home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp
/home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp:1541:26: error: unterminated raw string
   EXPECT_THAT(signatures(R"cpp(
                          ^
/home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp:1548:7: warning: missing terminating " character [enabled by default]
   )cpp")
       ^
/home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp:1541:3: error: stray ‘R’ in program
   EXPECT_THAT(signatures(R"cpp(
   ^
/home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp:1541:3: error: missing terminating " character
/home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp:1552:26: error: unterminated raw string
   EXPECT_THAT(signatures(R"cpp(
                          ^
/home/buildslave/buildslave1a/<wbr>clang-x86_64-linux-abi-test/<wbr>llvm/tools/clang/tools/extra/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp:1558:10: warning: missing terminating " character [enabled by default]
     })cpp")
          ^</span><br>etc...</pre></div></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 14, 2018 at 2:36 AM, Ilya Biryukov via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ibiryukov<br>
Date: Tue Aug 14 02:36:32 2018<br>
New Revision: 339665<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=339665&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=339665&view=rev</a><br>
Log:<br>
[clangd] Show non-instantiated decls in signatureHelp<br>
<br>
Summary:<br>
To avoid producing very verbose output in substitutions involving<br>
typedefs, e.g.<br>
  T -> std::vector<std::string>::<wbr>iterator<br>
gets turned into an unreadable mess when printed out for libstdc++,<br>
result contains internal types (std::__Vector_iterator<...>) and<br>
expanded well-defined typedefs (std::basic_string<char>).<br>
<br>
Until we improve the presentation code in clang, going with<br>
non-instantiated decls looks like a better UX trade-off.<br>
<br>
Reviewers: hokein, ioeric, kadircet<br>
<br>
Reviewed By: hokein<br>
<br>
Subscribers: MaskRay, jkorous, arphaman, cfe-commits<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D50645" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D50645</a><br>
<br>
Modified:<br>
    clang-tools-extra/trunk/<wbr>clangd/CodeComplete.cpp<br>
    clang-tools-extra/trunk/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>clangd/CodeComplete.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CodeComplete.cpp?rev=339665&r1=339664&r2=339665&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clangd/CodeComplete.cpp?<wbr>rev=339665&r1=339664&r2=<wbr>339665&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>clangd/CodeComplete.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>clangd/CodeComplete.cpp Tue Aug 14 02:36:32 2018<br>
@@ -714,7 +714,15 @@ public:<br>
            "too many arguments");<br>
     SigHelp.activeParameter = static_cast<int>(CurrentArg);<br>
     for (unsigned I = 0; I < NumCandidates; ++I) {<br>
-      const auto &Candidate = Candidates[I];<br>
+      OverloadCandidate Candidate = Candidates[I];<br>
+      // We want to avoid showing instantiated signatures, because they may be<br>
+      // long in some cases (e.g. when 'T' is substituted with 'std::string', we<br>
+      // would get 'std::basic_string<char>').<br>
+      if (auto *Func = Candidate.getFunction()) {<br>
+        if (auto *Pattern = Func-><wbr>getTemplateInstantiationPatter<wbr>n())<br>
+          Candidate = OverloadCandidate(Pattern);<br>
+      }<br>
+<br>
       const auto *CCS = Candidate.<wbr>CreateSignatureString(<br>
           CurrentArg, S, *Allocator, CCTUInfo, true);<br>
       assert(CCS && "Expected the CodeCompletionString to be non-null");<br>
<br>
Modified: clang-tools-extra/trunk/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp?rev=339665&r1=339664&r2=339665&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/unittests/clangd/<wbr>CodeCompleteTests.cpp?rev=<wbr>339665&r1=339664&r2=339665&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp (original)<br>
+++ clang-tools-extra/trunk/<wbr>unittests/clangd/<wbr>CodeCompleteTests.cpp Tue Aug 14 02:36:32 2018<br>
@@ -1537,6 +1537,59 @@ TEST(SignatureHelpTest, OverloadsOrderin<br>
   EXPECT_EQ(0, Results.activeParameter);<br>
 }<br>
<br>
+TEST(SignatureHelpTest, InstantiatedSignatures) {<br>
+  EXPECT_THAT(signatures(R"cpp(<br>
+    template <class T><br>
+    void foo(T, T, T);<br>
+<br>
+    int main() {<br>
+      foo<int>(^);<br>
+    }<br>
+  )cpp")<br>
+                  .signatures,<br>
+              ElementsAre(Sig("foo(T, T, T) -> void", {"T", "T", "T"})));<br>
+<br>
+  EXPECT_THAT(signatures(R"cpp(<br>
+    template <class T><br>
+    void foo(T, T, T);<br>
+<br>
+    int main() {<br>
+      foo(10, ^);<br>
+    })cpp")<br>
+                  .signatures,<br>
+              ElementsAre(Sig("foo(T, T, T) -> void", {"T", "T", "T"})));<br>
+<br>
+  EXPECT_THAT(signatures(R"cpp(<br>
+    template <class ...T><br>
+    void foo(T...);<br>
+<br>
+    int main() {<br>
+      foo<int>(^);<br>
+    }<br>
+  )cpp")<br>
+                  .signatures,<br>
+              ElementsAre(Sig("foo(T...) -> void", {"T..."})));<br>
+<br>
+  // It is debatable whether we should substitute the outer template parameter<br>
+  // ('T') in that case. Currently we don't substitute it in signature help, but<br>
+  // do substitute in code complete.<br>
+  // FIXME: make code complete and signature help consistent, figure out which<br>
+  // way is better.<br>
+  EXPECT_THAT(signatures(R"cpp(<br>
+    template <class T><br>
+    struct X {<br>
+      template <class U><br>
+      void foo(T, U);<br>
+    };<br>
+<br>
+    int main() {<br>
+      X<int>().foo<double>(^)<br>
+    }<br>
+  )cpp")<br>
+                  .signatures,<br>
+              ElementsAre(Sig("foo(T, U) -> void", {"T", "U"})));<br>
+}<br>
+<br>
 } // namespace<br>
 } // namespace clangd<br>
 } // namespace clang<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>