http://llvm.org/bugs/show_bug.cgi?id=8526
Summary: anonymous namespace prevents codegen outside namespace
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
$ clang++ --version
clang version 2.9 (trunk 118011)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang++ -c bug.cpp -o out.o && nm out.o
$
(empty output)
$ cat bug.cpp
namespace { // removing namespace makes it work
class Inner {
};
}
template<class D>
class _Outer{
public:
_Outer() {}
};
typedef _Outer<Inner> Outer;
class Foo {
public:
Outer bar() const;
};
Outer Foo::bar() const { // not emited. "nm out.o" is empty
return Outer();
}
============
As seen, Foo::bar is not emited. Removing the anonymous namespace makes it
work. Changing the return type (Outer) to something not related the the
anonymous namespace also makes it work.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs