https://bugs.llvm.org/show_bug.cgi?id=37279
Bug ID: 37279
Summary: Unexpected internal linkage when using an alias to an
private class
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: oli...@apple.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
I am not sure if clang's behaviour is wrong, but the behaviour is unexpected.
The basic issue is that I can have a public alias to a private type, but if the
alias appears in a method declaration the method is given internal linkage.
Here's a trivial example (compile with clang++ -c):
namespace Foo {
namespace {
struct _X {
int y;
};
}
using X = _X;
}
namespace Foo {
struct Bar {
X womp();
};
}
Foo::Bar *thing();
int main() {
thing()->womp();
return 0;
}
Bug 20296 seems to be similar, but that seems to be related to class protection
rather than anonymous namespaces
Given that the X alias public it seems expected that the method should not
receive internal linkage. That would be my /expectation/, if the actual
specification is different, it would be great if the warning actually said why
a method got internal linkage.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs