Update documentation with regards to template type diffing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159249 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/docs/InternalsManual.html b/docs/InternalsManual.html
index ca870c4..c97acd1 100644
--- a/docs/InternalsManual.html
+++ b/docs/InternalsManual.html
@@ -357,6 +357,11 @@
<tr><td>Example:</td><td><tt>"candidate found by name lookup is %q0"</tt></td></tr>
<tr><td>Class:</td><td>NamedDecl*</td></tr>
<tr><td>Description</td><td><p>This formatter indicates that the fully-qualified name of the declaration should be printed, e.g., "std::vector" rather than "vector".</p></td></tr>
+
+<tr><td colspan="2"><b>"diff" format</b></td></tr>
+<tr><td>Example:</td><td><tt>"no known conversion %diff{from | to | }1,2"</tt></td></tr>
+<tr><td>Class:</td><td>QualType</td></tr>
+<tr><td>Description</td><td><p>This formatter takes two QualTypes and attempts to print a template difference between the two. If tree printing is off, the entire text inside the the braces, with the formatted text replacing the pipes. If tree printing is on, the text is not printed and a type tree is printed after the diagnostic message.</p></td></tr>
</table>
diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html
index 7bca3bf..b820e8d 100644
--- a/docs/ReleaseNotes.html
+++ b/docs/ReleaseNotes.html
@@ -121,6 +121,55 @@
This functionality can be enabled or disabled separately from
<tt>-Wuninitialized</tt> with the <tt>-Wsometimes-uninitialized</tt> warning
flag.</li>
+
+ <li>Template type diffing improves the display of diagnostics with templated
+ types in them.
+
+<pre>
+int f(vector<map<int, double>>);
+int x = f(vector<map<int, float>>());
+</pre>
+ The error message is the same, but the note is different based on the options selected.
+<pre>
+<b>template-diff.cpp:5:9: <span class="error">error:</span> no matching function for call to 'f'</b>
+int x = f(vector<map<int, float>>());
+ <span class="caret">^</span>
+</pre>
+ Templated type diffing with type elision (default):
+<pre>
+<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion from 'vector<map<[...], <span class="template-highlight">float</span>>>' to 'vector<map<[...], <span class="template-highlight">double</span>>>' for 1st argument;
+int f(vector<map<int, double>>);
+ <span class="caret">^</span>
+</pre>
+ Templated type diffing without type elision (-fno-elide-type):
+<pre>
+<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion from 'vector<map<int, <span class="template-highlight">float</span>>>' to 'vector<map<int, <span class="template-highlight">double</span>>>' for 1st argument;
+int f(vector<map<int, double>>);
+ <span class="caret">^</span>
+</pre>
+ Templated tree printing with type elision (-fdiagnostics-show-template-tree):
+<pre>
+<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion for 1st argument;
+ vector<
+ map<
+ [...],
+ [<span class="template-highlight">float</span> != <span class="template-highlight">double</span>]>>
+int f(vector<map<int, double>>);
+ <span class="caret">^</span>
+</pre>
+ Templated tree printing without type elision (-fdiagnostics-show-template-tree -fno-elide-type):
+<pre>
+<b>template-diff.cpp:4:5: <span class="note">note:</span></b> candidate function not viable: no known conversion for 1st argument;
+ vector<
+ map<
+ int,
+ [<span class="template-highlight">float</span> != <span class="template-highlight">double</span>]>>
+int f(vector<map<int, double>>);
+ <span class="caret">^</span>
+</pre>
+
+ </li>
+
</ul>
<h4 id="tlsmodel">Support for <code>tls_model</code> attribute</h4>
diff --git a/docs/UsersManual.html b/docs/UsersManual.html
index ae9ebfa..6a620d2 100644
--- a/docs/UsersManual.html
+++ b/docs/UsersManual.html
@@ -417,6 +417,48 @@
"\xxx").</p>
</dd>
+<dt id="opt_fno-elide-type">
+<b>-fno-elide-type</b>:
+Turns off elision in template type printing.</td>
+<dd><p>The default for template type printing is to elide as many template
+arguments as possible, removing those which are the same in both template types,
+leaving only the differences. Adding this flag will print all the template
+arguments. If supported by the terminal, highlighting will still appear on
+differing arguments.</p>
+
+Default:
+<pre>
+t.cc:4:5: <span class="note">note</span>: candidate function not viable: no known conversion from 'vector<map<[...], map<<span class="template-highlight">float</span>, [...]>>>' to 'vector<map<[...], map<<span class="template-highlight">double</span>, [...]>>>' for 1st argument;
+</pre>
+-fno-elide-type:
+<pre>
+t.cc:4:5: <span class="note">note</span>: candidate function not viable: no known conversion from 'vector<map<int, map<<span class="template-highlight">float</span>, int>>>' to 'vector<map<int, map<<span class="template-highlight">double</span>, int>>>' for 1st argument;
+</pre>
+</dd>
+
+<dt id="opt_fdiagnostics-show-template-tree">
+<b>-fdiagnostics-show-template-tree</b>:
+Template type diffing prints a text tree.</td>
+<dd><p>For diffing large templated types, this option will cause Clang to
+display the templates as an indented text tree, one argument per line, with
+differences marked inline. This is compatible with -fno-elide-type.</p>
+
+Default:
+<pre>
+t.cc:4:5: <span class="note">note</span>: candidate function not viable: no known conversion from 'vector<map<[...], map<<span class="template-highlight">float</span>, [...]>>>' to 'vector<map<[...], map<<span class="template-highlight">double</span>, [...]>>>' for 1st argument;
+</pre>
+-fdiagnostics-show-template-tree
+<pre>
+t.cc:4:5: <span class="note">note</span>: candidate function not viable: no known conversion for 1st argument;
+ vector<
+ map<
+ [...],
+ map<
+ [<span class="template-highlight">float</span> != <span class="template-highlight">float</span>],
+ [...]>>>
+</pre>
+</dd>
+
</dl>