public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dodji at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
Date: Wed, 29 Oct 2008 21:56:00 -0000	[thread overview]
Message-ID: <20081029215625.20886.qmail@sourceware.org> (raw)
In-Reply-To: <bug-26693-1771@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from dodji at gcc dot gnu dot org  2008-10-29 21:56 -------
I think the problem is due to the fact that in general, grokdeclarator() in
gcc/cp/decl.c does not properly set the type variant node for typedef
statements.

To understand this way of representing the relationship between a type and its
typedef names, please read the comment of function clone_underlying_type, in
gcc/c-decl.c.

So grokdeclarator() does not properly create the typedef type variant for the
typedef statement. Later, build_functional_cast in gcc/cp/typeck2.c looses the
information about the typedef. It just takes in account the initial type.

So later at templater instanciation time, there is no chance left to check the
access of the typedef name, as we only know about the initial type.

So in grokdeclarator() I think we should properly create the typedef type
variant for the typedef statement encountered during the parsing of a class
member.

Then later at template instanciation time we can have a chance to check for the
access of the typedef name as its information is still present via the typedef
type variant associated to the initial type.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693


  parent reply	other threads:[~2008-10-29 21:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 " reichelt at gcc dot gnu dot org
2006-03-15 13:24 ` [Bug c++/26693] " pinskia at gcc dot gnu dot org
2006-06-04 18:06 ` mmitchel at gcc dot gnu dot org
2006-09-07  7:18 ` jason at gcc dot gnu dot org
2007-02-03 16:24 ` [Bug c++/26693] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
2007-02-14  9:10 ` mmitchel at gcc dot gnu dot org
2008-07-04 20:22 ` [Bug c++/26693] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-08-21 11:59 ` paolo dot carlini at oracle dot com
2008-10-28 12:17 ` dodji at gcc dot gnu dot org
2008-10-29 21:56 ` dodji at gcc dot gnu dot org [this message]
2008-11-01 14:31 ` dodji at gcc dot gnu dot org
2009-01-21 16:15 ` dodji at gcc dot gnu dot org
2009-01-22  7:16 ` dodji at gcc dot gnu dot org
2009-03-24 13:55 ` howarth at nitro dot med dot uc dot edu
2009-03-28 20:19 ` reichelt at gcc dot gnu dot org
2009-03-31 19:31 ` [Bug c++/26693] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-04-02  9:24 ` dodji at gcc dot gnu dot org
2009-04-02  9:36 ` dodji at gcc dot gnu dot org
2009-04-02  9:39 ` dodji at gcc dot gnu dot org
2009-04-02  9:45 ` jakub at gcc dot gnu dot org
2009-04-29  7:09 ` pinskia at gcc dot gnu dot org
2009-05-05 13:07 ` jwakely dot gcc at gmail dot com

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=20081029215625.20886.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).