<html>
<head>
<base href="https://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 --- - clang-cl treats different extern "C" declarations as redeclarations"
href="https://llvm.org/bugs/show_bug.cgi?id=29142">29142</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-cl treats different extern "C" declarations as redeclarations
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.9
</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>normal
</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>6yearold@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The code
namespace acommon {
struct ErrorInfo;
extern "C" __declspec(dllexport) const ErrorInfo * const aerror_other;
}
extern "C" {
struct AspellErrorInfo {
const struct AspellErrorInfo * isa;
const char * mesg;
unsigned int num_parms;
const char * parms[3];
};
typedef struct AspellErrorInfo AspellErrorInfo;
extern const struct AspellErrorInfo * const aerror_other;
}
int main()
{
return 0;
}
compiles with cl.exe, but fails with clang-cl.exe:
tst.cpp(25,45): error: redeclaration of 'aerror_other' with a different type:
'const struct AspellErrorInfo *const' vs 'const acommon::ErrorInfo *const'
extern const struct AspellErrorInfo * const aerror_other;
^
tst.cpp(6,59): note: previous declaration is here
extern "C" __declspec(dllexport) const ErrorInfo * const aerror_other;
^</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>