<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 - conflicting types error when using '_com_ptr_t' on clang 9.0 RC"
href="https://bugs.llvm.org/show_bug.cgi?id=42923">42923</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>conflicting types error when using '_com_ptr_t' on clang 9.0 RC
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</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>release blocker
</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>Zachary.Henkel@microsoft.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>clang 9.0 RC built with msvc version 19.22.27905 for x64. The attached example
compiles fine on clang 8.0.1 and on msvc.
An odd thing that I noticed is that -std=c++14 works fine, it's only -std=c++17
that causes these errors.
I've attached a fully preprocessed file in case an msvc installation & clang-cl
aren't handy. Run clang -c -Wno-everything -std=c++17 min_repro.cpp
D:\>clang -c -Wno-everything -std=c++17 D:\temp\min_repro.cpp
D:\temp\min_repro.cpp:67792:16: error: conflicting types for '_com_ptr_t'
template<> _com_ptr_t(Interface* pInterface) throw()
^
D:\temp\min_repro.cpp:68735:13: note: in instantiation of template class
'_com_ptr_t<_com_IIID<IUnknown,
&__uuidof(IUnknown)> >' requested here
IUnknownPtr Foo() {
^
D:\temp\min_repro.cpp:67792:16: note: previous declaration is here
template<> _com_ptr_t(Interface* pInterface) throw()
^
D:\temp\min_repro.cpp:67865:28: error: conflicting types for 'operator='
template<> _com_ptr_t& operator=(Interface* pInterface) throw()
^
D:\temp\min_repro.cpp:67865:28: note: previous declaration is here
D:\temp\min_repro.cpp:68011:21: error: conflicting types for 'operator=='
template<> bool operator==(const _com_ptr_t& p) const throw()
^
D:\temp\min_repro.cpp:68011:21: note: previous declaration is here
3 errors generated.
Optionally if an msvc command prompt is available:
D:\>type repro.cpp
#include <comdef.h>
IUnknownPtr Foo() {
return nullptr;
}
D:\>clang-cl.exe -c -std:c++17 -TP -W0 repro.cpp
** Same Errors</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>