From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 370 invoked by alias); 5 Nov 2013 11:59:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28438 invoked by uid 48); 5 Nov 2013 11:57:27 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58993] incorrectly accept access of protected member method from derived class template Date: Tue, 05 Nov 2013 11:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.3 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on blocked short_desc everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg00322.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58993 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid Status|UNCONFIRMED |NEW Last reconfirmed| |2013-11-05 Blocks| |59002 Summary|failure to access pointer |incorrectly accept access |to protected member method |of protected member method |in base from derived class |from derived class template |specialization | Ever confirmed|0 |1 --- Comment #2 from Jonathan Wakely --- Reduced test, where the base member is private, but the primary template can still access it class base { private: int foo() { } }; template struct bar : public base { void test() { &base::foo; // should be rejected } }; template <> struct bar : public base { void test() { // &base::foo; // correctly rejected } }; int main() { bar().test(); bar().test(); }