public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/8772: Segmentation fault on 3 lines of template code
Date: Mon, 02 Dec 2002 14:56:00 -0000	[thread overview]
Message-ID: <20021202225602.15357.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/8772; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: bangerth@dealii.org
Cc: gcc-bugs@gcc.gnu.org, zack@codesourcery.com, pcarlini@unitus.it,
   sneechy@hotmail.com, gcc-gnats@gcc.gnu.org
Subject: Re: c++/8772: Segmentation fault on 3 lines of template code
Date: 02 Dec 2002 23:49:28 +0100

 bangerth@dealii.org writes:
 
 | Synopsis: Segmentation fault on 3 lines of template code
 | 
 | State-Changed-From-To: open->analyzed
 | State-Changed-By: bangerth
 | State-Changed-When: Mon Dec  2 12:45:29 2002
 | State-Changed-Why:
 |     Others have confirmed this already.
 |     
 |     However, just for the record: I fail to see how this can be
 |     made legal: when you write A<n>::B to denote the template
 |     type, B is a template dependent type, and one would think
 |     one has to write a "typename" somewhere. But then we have
 |       typename A<n>::B
 |     which is not the name of a type, but of a template. I don't
 |     know what the standard says here, but I don't see a way to
 |     make it legal in any case.
 
 This case seems to be forgotten by the standard.  I think the
 following should make GCC happy.
 
   template<int n>
      struct D  {
        enum { 
          v = C<A<n>::template B>::v
        };
      };
 
 Note the "template" keyword in front of B.
 
 The closest you can find in the standard is 14.2/
 
     4
       When the name of a member template specialization appears after . or
       -> in a postfix-expression, or after nested-name-specifier in a
       qualified-id, and the postfix-expression or qualified-id explicitly
       depends on a template-parameter (14.6.2), the member template name
       must be prefixed by the keyword template. Otherwise the name is
       assumed to name a non-template. [ example not reproduced ]
 
     5
       If a name prefixed by the keyword template is not the name of a
       member template, the program is ill-formed.
 
 -- Gaby


             reply	other threads:[~2002-12-02 22:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-02 14:56 Gabriel Dos Reis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-20  9:46 Volker Reichelt
2003-01-18  9:36 Gabriel Dos Reis
2003-01-17 15:56 Wolfgang Bangerth
2003-01-17 14:56 Volker Reichelt
2002-12-03  8:16 Gabriel Dos Reis
2002-12-03  8:06 Wolfgang Bangerth
2002-12-02 12:45 bangerth
2002-12-01  1:46 Paolo Carlini

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=20021202225602.15357.qmail@sources.redhat.com \
    --to=gdr@integrable-solutions.net \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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).