public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65943] New: template keyword required for base-specifier that names member of the current instantiation
Date: Thu, 30 Apr 2015 09:04:00 -0000	[thread overview]
Message-ID: <bug-65943-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65943

            Bug ID: 65943
           Summary: template keyword required for base-specifier that
                    names member of the current instantiation
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

template<class A> struct X
{
    template<class B> struct Base;
    template<class B> struct Data;
};

template<class A>
template<class B>
struct X<A>::Data : X<A>::Base<B>
{ };


This fails to compile:

f.cc:9:33: error: ‘typename X<A>::Base’ names ‘template<class A> template<class
B> struct X<A>::Base’, which is not a type
 struct X<A>::Data : X<A>::Base<B>
                                 ^
f.cc:9:27: error: ‘typename X<A>::Base’ names ‘template<class A> template<class
B> struct X<A>::Base’, which is not a type
 struct X<A>::Data : X<A>::Base<B>
                           ^
f.cc:10:1: error: expected class-name before ‘{’ token
 { };
 ^

Clang and EDG accept it.

It compiles if the base-specifier is changed to X<A>::template Base<B>, but I
think the addition of "but the name is not a member of the current
instantiation" to C++11 14.2 [temp.names] p4 should make it valid.

In any case, http://open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1710 will
definitely make it valid. See also
http://open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1812 and
http://open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#314
>From gcc-bugs-return-485039-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 30 09:05:10 2015
Return-Path: <gcc-bugs-return-485039-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23585 invoked by alias); 30 Apr 2015 09:05:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23513 invoked by uid 48); 30 Apr 2015 09:05:07 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59955] Segmentation fault on (re?)defining a struct template as function template, when inside a struct tempate
Date: Thu, 30 Apr 2015 09:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.3
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution target_milestone
Message-ID: <bug-59955-4-FwSkJw4oJ9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59955-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59955-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg02591.txt.bz2
Content-length: 488

https://gcc.gnu.org/bugzilla/show_bug.cgi?idY955

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


             reply	other threads:[~2015-04-30  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30  9:04 redi at gcc dot gnu.org [this message]
2020-11-10 17:38 ` [Bug c++/65943] " redi at gcc dot gnu.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=bug-65943-4@http.gcc.gnu.org/bugzilla/ \
    --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).