This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52373] New: template usage drops some checks on the accessibility of a member
- From: "sylvestre at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Feb 2012 16:37:42 +0000
- Subject: [Bug c++/52373] New: template usage drops some checks on the accessibility of a member
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52373
Bug #: 52373
Summary: template usage drops some checks on the accessibility
of a member
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sylvestre@debian.org
Considering this code:
----
class A
{
struct st
{
static void f();
};
};
template <typename t> void foo()
{
A::st::f();
}
---
g++ accepts it.
If I remove "template <typename t>", an error is triggered (which is the
expected behavior):
plop.cpp: In function âvoid foo()â:
plop.cpp:4:12: error: âstruct A::stâ is private
plop.cpp:12:5: error: within this context