<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Clang is reporting wrong "previous declaration is here" notes"
href="https://bugs.llvm.org/show_bug.cgi?id=32347">32347</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang is reporting wrong "previous declaration is here" notes
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>heavenandhell171@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Clang version 5.0.0 (trunk 298027)
This snippet is from the Microsoft STL contained in one of the recent MSVC
nightly builds.
$ cat Test.cpp
template<class _Size_type> inline
_Size_type _Convert_size(const size_t _Len)
{ // convert size_t to _Size_type, avoiding truncation
return (static_cast<_Size_type>(_Len));
}
template<> inline
size_t _Convert_size<size_t>(const size_t _Len) noexcept
{ // convert size_t to size_t, unchanged
return (_Len);
}
$ clang-cl Test.cpp -std:c++latest
Test.cpp(8,10): warning: exception specification in declaration does not match
previous declaration
[-Wmicrosoft-exception-spec]
size_t _Convert_size<size_t>(const size_t _Len) noexcept
^
Test.cpp(8,10): note: previous declaration is here
Test.cpp(8,10): error: conflicting types for '_Convert_size'
size_t _Convert_size<size_t>(const size_t _Len) noexcept
^
Test.cpp(8,10): note: previous declaration is here
1 warning and 1 error generated.
Note how both notes are wrong. They don't have diagnostics, and point to the
same location of the error/warning.</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>