<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Improve error message with brief type-information"
href="http://llvm.org/bugs/show_bug.cgi?id=16012">16012</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Improve error message with brief type-information
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>gonzalobg88@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Let the following be an example error message:
In file included from /Path/To/Some/File/test.cpp:3:
/usr/bin/../lib/c++/v1/algorithm:3494:18: error: no viable overloaded '='
*__j = _VSTD::move(__t);
For errors involving the STL and Boost, the compiler usually spites messages
between one and a couple hundred pages long. Experienced developers _often_
know what to look for _and_ where (e.g. beginning/end of error report). Still,
most of the compilation errors I see are because some expression somewhere
doesn't have the type it should (e.g. forgot to dereference a pointer?). C++ is
a strongly typed language, i.e. the compiler knows all/most of the types
involved in the expression that triggered the error (unless it was a type
deduction error). So why don't display that information in a _brief_ way?
Example:
In file included from /Path/To/Some/File/test.cpp:3:
/usr/bin/../lib/c++/v1/algorithm:3494:18: error: no viable overloaded '='
*__j = _VSTD::move(__t);
expanded to: // perform all macro expansions
*__j = std::_LIBCPP_NAMESPACE::move(__t);
with types // table with all types(local names + aka names)
__j has type: RandomAccessIterator <aka double*>
*__j has type: RandomAccesIterator::reference_type <aka double>
__t has type: ...
_VSTD::move(__t) has type: ...
// From here on, provide the usual error message with all its information.
// Hopefully the user won't have to look at it.
So I propose the following. Display:
- expression before and after macro expansion, and
- display types before and after substitution.
Maybe also mark types in different colors. Something like this:
*__j = _VSTD::move(__t);
expanded to: // perform all macro expansions
*__j = std::_LIBCPP_NAMESPACE::move(__t);
^^^ ^^^ // use different colors for
^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // different types.
I don't know how feasible this would be, but I think it would be a huge
improvement to the current error messages.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>