public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dodji at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53540] C++11: using fails to be equivalent to typedef
Date: Wed, 10 Oct 2012 10:44:00 -0000	[thread overview]
Message-ID: <bug-53540-4-FBIJ3TrUFk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53540-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #8 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-10-10 10:44:02 UTC ---
Author: dodji
Date: Wed Oct 10 10:43:53 2012
New Revision: 192304

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192304
Log:
PR c++/53540 - using fails to be equivalent to typedef

In the example of this problem report, during the substituting of int
into 'function', tsubst_aggr_type fails for the alias ctxt1.  This is
because TYPE_TEMPLATE_INFO looks for the TEMPLATE_INFO of the ctxt1
alias at the wrong place and was wrongly finding it to be NULL.
Namely, it was looking for it in the DECL_TEMPLATE_INFO of the
declaration of the type -- as if ctxt1 was an alias template
specialization -- rather than looking for it in its
CLASSTYPE_TEMPLATE_INFO.

Fixed thus.  The other hunks of the patch are a cleanup to make a
better use of alias_template_specialization_p.

Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.

gcc/cp

    * cp-tree.h (TYPE_TEMPLATE_INFO): For an alias that is not an
    instance of alias template, don't look for its TEMPLATE_INFO in
    its declaration.
    (alias_template_specialization_p): Take const_tree.
    * pt.c (alias_template_specialization_p): Take a const_tree.
    Don't call primary_template_instantiation_p.
    (primary_template_instantiation_p): Call
    alias_template_specialization_p.

gcc/testsuite/

    * g++.dg/cpp0x/alias-decl-24.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-24.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


  parent reply	other threads:[~2012-10-10 10:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 14:44 [Bug c++/53540] New: " akim.demaille at gmail dot com
2012-05-31 17:43 ` [Bug c++/53540] " redi at gcc dot gnu.org
2012-06-11 17:27 ` akim.demaille at gmail dot com
2012-08-16 19:09 ` dodji at gcc dot gnu.org
2012-08-16 19:11 ` dodji at seketeli dot org
2012-08-16 22:18 ` dodji at seketeli dot org
2012-10-05 21:29 ` paolo.carlini at oracle dot com
2012-10-08 14:27 ` dodji at seketeli dot org
2012-10-10 10:44 ` dodji at gcc dot gnu.org [this message]
2012-10-10 10:57 ` dodji at gcc dot gnu.org
2013-05-03  9:54 ` paolo.carlini at oracle 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=bug-53540-4-FBIJ3TrUFk@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).