<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 --- - name lookup of virtual base class member through using-declarations"
href="http://llvm.org/bugs/show_bug.cgi?id=19409">19409</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>name lookup of virtual base class member through using-declarations
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Trevor_Smigiel@playstation.sony.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>The following test case, example 6 from n1543, generates an ambiguous name
lookup error on trunk. Is generating an error correct? It seems unambiguous
(according to standard section 10.2 and n1543) because I1::f and I2::f
designate the same virtual base class member B::f.
struct B {
void f();
};
struct I1: virtual B {
using B::f;
};
struct I2: virtual B {
using B::f;
};
struct D: I1, I2 {
void g() {
f(); // unambiguous
}
};
# clang --version
clang version 3.5.0 (205993)
Target: x86_64-unknown-linux-gnu
Thread model: posix
# clang -std=c++11 -c c.cpp
c.cpp:13:9: error: member 'f' found in multiple base classes of different
types
f(); // unambiguous
^
c.cpp:6:14: note: member found by ambiguous name lookup
using B::f;
^
c.cpp:9:14: note: member found by ambiguous name lookup
using B::f;
^
1 error generated.
g++ 4.7 and 4.8 also generate an error for this case. I did not test other
versions of gcc.
For reference:
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#39">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#39</a>
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1543.pdf">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1543.pdf</a>
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1626.pdf">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1626.pdf</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>