<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 rejects "enum struct/class" in reference to enumeration"
href="https://bugs.llvm.org/show_bug.cgi?id=46603">46603</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang rejects "enum struct/class" in reference to enumeration
</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>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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>haoxintu@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Hi, all.
This code, test.cc, clang rejects it in trunk but accepts it in versions from
6.0 to 10.0.
$cat test.cc
using alias1 = enum struct E1;
using alias2 = enum class E2;
$clang++-trunk -c test.cc
test.cc:1:21: error: reference to enumeration must use 'enum' not 'enum struct'
[-Welaborated-enum-class]
using alias1 = enum struct E1;
^~~~~~~
test.cc:2:21: error: reference to enumeration must use 'enum' not 'enum class'
[-Welaborated-enum-class]
using alias2 = enum class E2;
^~~~~~
2 errors generated.
$clang++-10 -c test.cc
//emits nothing
My clang version is:
$clang++-trunk -v
clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
b9306fd042ce1c11d84f05d2124dfdc65b8331fe)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/compilers/llvm-project/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Selected multilib: .;@m64
I also tested this in GCC, and it accepts well. So I am wondering is this a
clang-trunk's reject-valid bug or GCC's accpet-invlaid bug?
Thanks,
Haoxin</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>