public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/8772: Segmentation fault on 3 lines of template code
Date: Fri, 17 Jan 2003 15:56:00 -0000	[thread overview]
Message-ID: <20030117155604.26249.qmail@sources.redhat.com> (raw)

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

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Cc: gcc-gnats@gcc.gnu.org, <sneechy@hotmail.com>, <gcc-bugs@gcc.gnu.org>,
   <gdr@integrable-solutions.net>
Subject: Re: c++/8772: Segmentation fault on 3 lines of template code
Date: Fri, 17 Jan 2003 09:46:45 -0600 (CST)

 > What are we going to do with the PR w.r.t. the how-to-make-to-code-legal
 > issue? Leave it open, close it, suspend it, open a new PR?
 
 Good question. Just to recall this briefly: this code
 ---------------
 template <int> struct A {
     template <int> struct B { enum { v = 1 }; };
 };
 
 template <template <int> class F> struct C {
     enum { v = F<1>::v || 2 };
 };
 
 template <int n> struct D {
     enum { v = C<A<n>::B>::v };
 };
 -----------------------
 generated an ICE (now errors), and the question was: is in the last line
   C<A<n>::B> 
 something meaningful? Wouldn't we have to write
   C<typename A<n>::B>
 ? This doesn't compile either presently. 
 
 Gaby's suggestion was that this needs to be further disambiguated as
   C<typename A<n>::template B>
 which would not be covered by the standard (the oversight Gaby spoke of), 
 but be reasonable. However, this still doesn't compile presently:
   g/a> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c x.cc
   x.cc:10: error: template argument 1 is invalid
 
 What does compile is (also with icc7, by the way)
   C<A<n>::template B>
 
 Gaby, is the latter the syntax you had in mind to be legal, i.e. put 
 differently: no need for "typename"?
 
 
 If yes, then I would say gcc presently does its best and we should close 
 the report. If the inquire Gaby did with the ISO committee finds some 
 other solution, then this will be put into a DR anyway, and there is no 
 need to keep the report open presently anyway.
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 


             reply	other threads:[~2003-01-17 15:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-17 15:56 Wolfgang Bangerth [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 14:56 Volker Reichelt
2002-12-03  8:16 Gabriel Dos Reis
2002-12-03  8:06 Wolfgang Bangerth
2002-12-02 14:56 Gabriel Dos Reis
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=20030117155604.26249.qmail@sources.redhat.com \
    --to=bangerth@ticam.utexas.edu \
    --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).