<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 --- - Redefinition of identical typedefs fails"
href="http://llvm.org/bugs/show_bug.cgi?id=18564">18564</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Redefinition of identical typedefs fails
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>fluffmail@f-m.fm
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>From C11 ยง6.7(3): "a typedef name may be redefined to denote the same type as
it currently does, provided that type is not a variably modified type."
So we should be able to redundantly duplicate the same typedef into a file with
no problem. But clang seems to have trouble identifying that duplicated
typedefs are duplicates. Sample code:
-------------
typedef struct {
int a;
double b;
} ab;
typedef struct {
int a;
double b;
} ab;
int main(){}
------------
Result:
<span class="quote">> clang --std=c11 bug.c</span >
bug.c:9:3: error: typedef redefinition with different types ('struct ab' vs
'struct ab')
} ab;
^
bug.c:4:3: note: previous definition is here
} ab;
^
1 error generated.
------------</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>