<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 --- - Accepts-invalid (?): clang allows accessing private typedef of specialization in the specialization's template"
href="http://llvm.org/bugs/show_bug.cgi?id=22350">22350</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Accepts-invalid (?): clang allows accessing private typedef of specialization in the specialization's template
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>normal
</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>nicolasweber@gmx.de
</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>clang accepts the following code, which gcc, cl, icc all reject. icc says
"warning #525: type "A<void>::const_pointer" (declared at line 3) is an
inaccessible type (allowed for cfront compatibility)", so this is probably a
clang bug (?)
$ cat repro.ii
template <class T1> class A;
template <> class A<void> {
typedef void *const_pointer;
};
template <class T1> class A {
void m_fn1(A<void>::const_pointer);
};
class F {
A<int> const_pointer;
};
$ bin/clang -c repro.ii
$ gcc-4.8.1 -c repro.ii
gcc-4.8.1: warning: couldn’t understand kern.osversion ‘14.0.0
repro.ii: In instantiation of ‘class A<int>’:
repro.ii:9:10: required from here
repro.ii:3:17: error: ‘typedef void* A<void>::const_pointer’ is private
typedef void *const_pointer;
^
repro.ii:6:23: error: within this context
void m_fn1(A<void>::const_pointer);
^</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>