<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 handling of the case when different name-lookup paths gives different access in multiple inheritence"
href="https://llvm.org/bugs/show_bug.cgi?id=24406">24406</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect handling of the case when different name-lookup paths gives different access in multiple inheritence
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</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>anders.granlund.0@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider the following program (prog.cc):
struct A { protected: static const int x = 0; };
struct B : A {};
struct C : A { using A::x; };
struct D : B, C {};
int main() { D::x; }
Compile it with the following command line:
clang++ prog.cc -std=c++14 -pedantic-errors
The following error message is then given:
prog.cc:9:17: error: 'f' is a protected member of 'A'
int main() { D::f(); }
^
prog.cc:1:35: note: declared protected here
struct A { protected: static void f() {} };
^
1 error generated.
According to [class.paths]p1 (<a href="http://eel.is/c++draft/class.paths#1">http://eel.is/c++draft/class.paths#1</a>):
"If a name can be reached by several paths through a multiple inheritance
graph, the access is that of the path that gives most access."
So the program should be well-formed and I expected to get no error messages
therefore.</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>