<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 --- - incorrect error on correct code and crash on bad code in forward declaration of enum in template"
href="https://llvm.org/bugs/show_bug.cgi?id=22943">22943</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>incorrect error on correct code and crash on bad code in forward declaration of enum in template
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.5
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>camorton2@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>template<class T> struct A {
enum E : T;
};
A<int> a;
template<class T> enum A<T>::E : T { e1, e2 };
#if _WRONG
A<int>::E er = e1;
#else
A<int>::E e = A<int>::e1;
#endif
Should compile clean but with
clang++ -std=c++11
a.cpp:9:15: error: no member named 'e1' in 'A<int>'; did you mean simply 'e1'?
A<int>::E e = A<int>::e1;
^~~~~~~~~~
e1
a.cpp:5:38: note: 'e1' declared here
template<class T> enum A<T>::E : T { e1, e2 };
clang++ -std=c++11 -D_WRONG
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (tags/RELEASE_350/final)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************
Testcase (not _WRONG) section is taken directly from the C++2011 standard
14.5.1.4 Enumeration members of class templates
the _WRONG section was an attempt to fix according to the clang diagnostic
message.</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>