User account creation filtered due to spam.

Bug 52373 - template usage drops some checks on the accessibility of a member
Summary: template usage drops some checks on the accessibility of a member
Status: RESOLVED DUPLICATE of bug 41437
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 16:37 UTC by Sylvestre Ledru
Modified: 2012-02-24 16:50 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvestre Ledru 2012-02-24 16:37:42 UTC
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
Comment 1 Jonathan Wakely 2012-02-24 16:50:25 UTC
dup

*** This bug has been marked as a duplicate of bug 41437 ***