<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 - Inconsistency: enumerator name is found only if not qualified"
href="https://bugs.llvm.org/show_bug.cgi?id=35401">35401</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inconsistency: enumerator name is found only if not qualified
</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>C++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jenda.tusil@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This code does compile. If we replace (1) with (2), it does compile, which is
weird and likely wrong.
namespace N { enum E : int; }
enum N::E : int {A,B};
int bar() {
//return int(::A); // 1
return int(A); // 2
}
Clang reject the commented line in function bar(), but accepts the line below.
I think it should either accept both or reject both. Gcc does reject both.
However, maybe compilers should accept both lines, because N4296 says in
7.2/11:
<span class="quote">> Each enum-name and each unscoped enumerator is declared in the scope that
> immediately contains the enum-specifier.</span >
which is to global scope.
The problem originally appeared in this SO question:
<a href="https://stackoverflow.com/q/47383199/6209703">https://stackoverflow.com/q/47383199/6209703</a></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>