[llvm-bugs] [Bug 26048] New: Missing diagnostic for overloaded names in anonymous unions
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jan 6 11:29:49 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=26048
Bug ID: 26048
Summary: Missing diagnostic for overloaded names in anonymous
unions
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: aprantl at apple.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Classification: Unclassified
class A {
class B {};
union {
B B; // This should be an error.
};
// Name lookup error if uncommented.
// sizeof(B);
};
As of r256962 this compiles fine, however
[class.union] §9.5.5 states that "The names of the members of an anonymous
union shall be distinct from the names of any other entity in the scope in
which the anonymous union is declared.”
This does generate a name lookup error if B is used, but that's too late.
--
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/20160106/cdd9b861/attachment.html>
More information about the llvm-bugs
mailing list