[llvm-bugs] [Bug 37279] New: Unexpected internal linkage when using an alias to an private class
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Apr 27 21:30:36 PDT 2018
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: unassignedclangbugs at nondot.org
Reporter: oliver at apple.com
CC: dgregor at apple.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180428/0393bf1c/attachment.html>
More information about the llvm-bugs
mailing list