<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 --- - befriending a member function of a nested class hides its default arguments"
href="http://llvm.org/bugs/show_bug.cgi?id=18432">18432</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>befriending a member function of a nested class hides its default arguments
</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>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>rjmccall@apple.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>usury:clang$ cat /tmp/red.cpp
struct A {
struct B {
B(int x = 0) {}
void foo(int x = 0);
};
friend B::B(int);
friend void B::foo(int);
};
void test() {
A::B b;
b.foo();
}
usury:clang$ clang -fsyntax-only /tmp/red.cpp
/tmp/red.cpp:11:8: error: no matching constructor for initialization of 'A::B'
A::B b;
^
/tmp/red.cpp:6:13: note: candidate constructor not viable: requires 1 argument,
but 0 were provided
friend B::B(int);
^
1 error generated.
usury:clang$ sed -i -e 's@friend B@//friend B@' /tmp/red.cpp
usury:clang$ clang -fsyntax-only /tmp/red.cpp
tmp/red.cpp:12:9: error: too few arguments to function call, expected 1, have 0
b.foo();
~~~~~ ^
/tmp/red.cpp:7:3: note: 'foo' declared here
friend void B::foo(int);
^
1 error generated.
These friend declarations are useless --- members of a nested class
automatically have friend-level access to the class --- but they shouldn't
interfere with the default arguments.</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>