public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@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
Date: Tue, 19 Apr 2005 18:25:00 -0000	[thread overview]
Message-ID: <20050419182508.29667.qmail@sourceware.org> (raw)
In-Reply-To: <20050413215022.21008.nicoara@roguewave.com>


------- 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 <typename T> struct B: public A { }; 
template <typename T> struct C: B<T> { 
     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


  parent reply	other threads:[~2005-04-19 18:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 21:50 [Bug c++/21008] New: " nicoara at roguewave dot com
2005-04-13 22:04 ` [Bug c++/21008] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-04-15  5:29 ` bangerth at dealii dot org
2005-04-19 15:39 ` sebor at roguewave dot com
2005-04-19 15:41 ` sebor at roguewave dot com
2005-04-19 18:25 ` bangerth at dealii dot org [this message]
2005-04-20 19:51 ` william dot m dot miller at gmail dot com
2005-04-20 20:14 ` william dot m dot miller at gmail dot com
2005-04-30 16:04 ` lerdsuwa at gcc dot gnu dot org
2005-05-19 16:45 ` [Bug c++/21008] [3.4/4.0/4.1 Regression] [DR515] Access " lerdsuwa at gcc dot gnu dot org
2005-05-19 17:30 ` mmitchel at gcc dot gnu dot org
2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:05 ` mmitchel at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050419182508.29667.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).