public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Nathan Sidwell <nathan.sidwell@blueyonder.co.uk>
To: nathan@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/9990: locale_facets.h contains invalid typedef
Date: Sun, 09 Mar 2003 15:56:00 -0000 [thread overview]
Message-ID: <20030309155601.10109.qmail@sources.redhat.com> (raw)
The following reply was made to PR c++/9990; it has been noted by GNATS.
From: Nathan Sidwell <nathan.sidwell@blueyonder.co.uk>
To: paolo@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nasgaard@ca.ibm.com, nathan@gcc.gnu.org, nobody@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c++/9990: locale_facets.h contains invalid typedef
Date: Sun, 09 Mar 2003 15:53:28 +0000
I can't tell if this is well formed or not.
typename ctype::mask is looked up at instantiation time. Now does it find the
typedef in ctype, or does it find the typedef in ctype_base? If this were
not a template class, it would find the latter, ctype::mask not being in scope
at the point of parsing the decl-spec.
I believe class template instantiation should behave as closely as possible
to the non-template equivalent. In which case the typename will find
the name in the base class, and then insert the typedef into the instantiated
class's scope. The standard doesn't specify precisely how instantiation
happens. There are (sort of) two choices
1) build up the instantiated class and its members much like a non-template
class definition is constructed. I.e. what I've described above
2) bind all the names declared, to types, functions, fields or whatever,
then instantiate each of those declared things.
IIRC gcc kind of does a mixture of the two :(
Anyway, even if we do 1, do we fall foul of [3.3.6]/2? I think we do.
note no diagnostic is required for such a violation. We also fail to issue one
for the non-template case of N being a qualified id. Such as,
struct B { typedef int X;};
struct C : B { typedef C::X Y;
int X;
};
I think this is really a 'request for change'
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
next reply other threads:[~2003-03-09 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-09 15:56 Nathan Sidwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-03-21 14:28 nathan
2003-03-09 11:54 paolo
2003-03-07 17:26 nasgaard
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=20030309155601.10109.qmail@sources.redhat.com \
--to=nathan.sidwell@blueyonder.co.uk \
--cc=gcc-prs@gcc.gnu.org \
--cc=nathan@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).