<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 --- - friend from different namespace doesn't work when return type is provided indirectly"
href="http://llvm.org/bugs/show_bug.cgi?id=16818">16818</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>friend from different namespace doesn't work when return type is provided indirectly
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>wygos@mimuw.edu.pl
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The code below doesn't compile. It compiles if you replace returning type
"type" with void. The code compiles on gcc 4.7.3. the code compiles if you
remove the "d" namesapce.
#include <iostream>
namespace n {
namespace d {
struct A;
}
class ReplacedType {
public:
typedef void type;
};
//forward declaration
ReplacedType::type
f(d::A);
namespace d {
struct A {
typedef ::n::ReplacedType::type type;
friend
type
// void
::n::f(A);
private:
int a;
};
}
ReplacedType::type
f(d::A a) {
std::cout << a.a <<std::endl;
}
}
int main() {
return 0;
}</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>