[llvm-bugs] [Bug 44708] New: clang++ accepts invalid code
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jan 29 08:50:32 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=44708
Bug ID: 44708
Summary: clang++ accepts invalid code
Product: clang
Version: 9.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: grzejabl at gmail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
The following code:
class A
{
friend class B;
int m;
};
class B
{
friend void f(A* p) { p->m = 32; }
};
compiles in clang version 9.0.0-2. If the function body is defined outside of
the class, the compiler correctly issues an error about not being able to
access the private member.
--
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/20200129/9fa8a3ca/attachment.html>
More information about the llvm-bugs
mailing list