<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 - [Regression] C++03 and lower fails to compile a union with a volatile struct that has a volatile struct filed"
href="https://bugs.llvm.org/show_bug.cgi?id=34683">34683</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Regression] C++03 and lower fails to compile a union with a volatile struct that has a volatile struct filed
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>arphaman@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following code fails to compile with LLVM 5 and above (with -std=C++03 or
less):
```
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef volatile struct {
uint16 field;
} t1;
typedef volatile struct {
t1 a;
} t2;
typedef volatile union {
t2 b;
} t3;
```
Clang reports the following error:
```
test.cpp:13:7: error: union member 'b' has a non-trivial copy constructor
t2 b;
^
test.cpp:9:7: note: because no constructor can be used to copy field of type
'const t1' (aka 'const volatile
(anonymous struct at test.cpp:4:18)')
t1 a;
^
1 error generated.
```
This is a new regression caused by r310983.</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>