From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29750 invoked by alias); 19 Apr 2005 18:25:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29668 invoked by uid 48); 19 Apr 2005 18:25:08 -0000 Date: Tue, 19 Apr 2005 18:25:00 -0000 Message-ID: <20050419182508.29667.qmail@sourceware.org> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050413215022.21008.nicoara@roguewave.com> References: <20050413215022.21008.nicoara@roguewave.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/21008] [3.4/4.0/4.1 Regression] Acess failure in accessing data member of base class from derived template class X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg02578.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2005-04-19 18:25 ------- Martin & Mike, I'm happy to reopen this PR. I understand your analysis, and in fact thought about it when I wrote my comment. Independently of whether it may be strictly mandated by the standard, I do have to admit that I find it confusing to see the semantics of something change at the time of instantiation, even though it was already bound at template definition time. I do think that this is a further complication of the already not quite so intuitive two-stage name lookup rules. But I guess that's immaterial. We're not into intuitive things, but into the letter of the law. Some people in this country already claim that lawyers stray too far from the letter of the law anyway, so we won't give them more reason to complain. Incidentally, two question: a) your reference to 9.3.1p3 must have been to something else. In TC1, 9.3.1 is on const and volatile member functions. b) how does your interpretation affect the validity of the following program: ------------------ struct A { int foo_; }; typedef int A::* pAi; template struct B: public A { }; template struct C: B { pAi foo() { return &A::foo_; } }; ----------------- If A::foo_ refers to the member variable *of the present object*, then taking its address returns an int*, not an "int A::*" object, right? However, I can't seem to find a compiler that would reject the code. Thanks Wolfgang -- What |Removed |Added ---------------------------------------------------------------------------- CC| |sebor at roguewave dot com, | |bangerth at dealii dot org Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21008