From: Dodji Seketeli <dodji@redhat.com>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: Jason Merrill <jason@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR c++/52343 - error with alias template as template template argument
Date: Mon, 24 Dec 2012 13:58:00 -0000 [thread overview]
Message-ID: <87sj6vft7f.fsf@redhat.com> (raw)
In-Reply-To: <CAAiZkiD4jmSVc=BgoRJHQsCx_HfFoL=qoLxyvBEoCrKAEVVS4Q@mail.gmail.com> (Gabriel Dos Reis's message of "Sun, 23 Dec 2012 23:38:45 -0600")
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
G> On Sun, Dec 23, 2012 at 11:04 PM, Jason Merrill <jason@redhat.com> wrote:
>> On 12/21/2012 07:35 AM, Dodji Seketeli wrote:
>>>
>>> else if (TREE_TYPE (t)
>>> && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (t))
>>> - && !TREE_CONSTANT (t))
>>> + && !TREE_CONSTANT (t)
>>> + /* Class template and alias template arguments should be OK.
>>> */
>>> + && !DECL_TYPE_TEMPLATE_P (t))
>>
>>
>> Instead, let's add a previous else if to catch template template arguments
>> (and do nothing) so that when we hit this else if, we know we're dealing
>> with a non-type argument.
>
> Thanks; that would make the logic clearer. I would suggest that we
> abstract this series of conjunction into a separate (static inline)
> function, e.g. nontype_argument_p.
These conjunctions represents a non-type argument only if they are
satisfied /and/ the previous 'if' branches are not taken. So just
putting the conjunctions in e.g, nontype_argument_p could be seen as
confusion too, IMHO.
Could we just consider that the patch + comment of my earlier message and the
comment of these conjunctions
/* A non-type argument of integral or enumerated type must be a
constant. */
should make this less confusing?
--
Dodji
next prev parent reply other threads:[~2012-12-24 13:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 12:35 Dodji Seketeli
2012-12-21 15:11 ` Gabriel Dos Reis
2012-12-21 16:26 ` Dodji Seketeli
2012-12-21 23:21 ` Gabriel Dos Reis
2012-12-22 15:53 ` Dodji Seketeli
2012-12-22 16:43 ` Gabriel Dos Reis
2012-12-24 5:04 ` Jason Merrill
2012-12-24 5:38 ` Gabriel Dos Reis
2012-12-24 13:58 ` Dodji Seketeli [this message]
2012-12-24 20:18 ` Gabriel Dos Reis
2012-12-24 13:50 ` Dodji Seketeli
2012-12-26 18:55 ` Jason Merrill
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=87sj6vft7f.fsf@redhat.com \
--to=dodji@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdr@integrable-solutions.net \
--cc=jason@redhat.com \
/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).