220 9825 <CANu6V4WZWY0+EWY=1_UWN1Yi8202mwCdiQQiLhY-hGFLCtAR6g@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Johannes Schaub <schaub.johannes@googlemail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: auto variable templates?
Date: Sun, 16 Mar 2014 01:31:35 +0100
Lines: 67
Approved: news@gmane.org
Message-ID: <CANu6V4WZWY0+EWY=1_UWN1Yi8202mwCdiQQiLhY-hGFLCtAR6g@mail.gmail.com>
References: <ec829ec4-9d4e-4d5c-8673-a58d46fec41b@isocpp.org>
	<CAOfiQqkf4N3Pga8V7n6as-CBdWWGJeKh-0s8ONxsdpRtamo-Cg@mail.gmail.com>
	<CANu6V4ViH09LeqDs_Vc2tivK97=6yThejGLJ6+m0dRx0Fu+vRQ@mail.gmail.com>
	<CAOfiQq=-DRrjX2sAxpqPhhorg4ARW9q4vNA=D5k7wHzikjMiBg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1394929888 14971 80.91.229.3 (16 Mar 2014 00:31:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 16 Mar 2014 00:31:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCQPNCEZSQNBB2HBSOMQKGQEP3ZQM7I@isocpp.org Sun Mar 16 01:31:39 2014
Return-path: <std-proposals+bncBCQPNCEZSQNBB2HBSOMQKGQEP3ZQM7I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pb0-f72.google.com ([209.85.160.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCQPNCEZSQNBB2HBSOMQKGQEP3ZQM7I@isocpp.org>)
	id 1WOyzK-0005Px-69
	for gclcip-std-proposals@m.gmane.org; Sun, 16 Mar 2014 01:31:38 +0100
Original-Received: by mail-pb0-f72.google.com with SMTP id jt11sf10197432pbb.11
        for <gclcip-std-proposals@m.gmane.org>; Sat, 15 Mar 2014 17:31:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlemail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=YUpu5UCe8ZMu7KWzIzcLO0ZmpKR7FiC01N0inXQGyyU=;
        b=pjOaLkmHY/mpgcdiRXhbOR9S2EsG8m5aaK2suBFY2hMQfBAAPTLjDMZcGB6JPO+ld+
         hicv9LFnHFunO7KKh1ZIZ9dskn3WgM1FdV2GsyjBb6FJXgX8NIArj8nKFbT0N5IUevi2
         HDjx0LseLTh1CnFRFN++O6eHqGHMTUyDM9oCORwJyrGmjTwN00LN4P3gUnV2Q+zRN2X1
         3MqP+9QEt6beMdQFHfkE5faZWHndWYZp6FJ4wrFNODN/khWdnFNRYk6bGddreldNKCkj
         oyzFVI75DpBcNxAOVV9hJC9uHFnEkoid9F0C99VJ6OT26cC2yRIX/rz0MYK4Rl18gi1M
         65GA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=YUpu5UCe8ZMu7KWzIzcLO0ZmpKR7FiC01N0inXQGyyU=;
        b=ApLj95ZnUNmhZPmvmboKjIQRted1yOj7OsT1eg7b2lr2RNUBh5SCBaQY4+lOygGpq7
         ksqXngAgfQcaSiYSz5GRhlSg1jfXy/61DVtWxMCUnXLhAv891Y1Hh6TDqDx+/twBAKY/
         Uo3aF1EUz494fOWgn5WyhyBzJT34DYTt2I4O0FBQ8pvxNGrGga57KxAlbEhyPCRJIbiX
         880okUB+4OKajoSOtul8qowSnYH0r2TAHNOSk3mQzhvXgNozJHvNfQLxM4OH1VoTCswe
         FlMiWxt9INAMPLkat/94/7VC33Pe6eL90RZTEH3TWb4nOZa3uI9iyH+mB/xvQoK/hDn/
         M8LA==
X-Gm-Message-State: ALoCoQnMt2QIU20hbOzj6Kbb0S6I2D0DsyRSWc/ln0toTQLIoJGubf6ZXGPvGcQ6C69rm4yR1Ow2
X-Received: by 10.66.158.6 with SMTP id wq6mr6322487pab.39.1394929896928;
        Sat, 15 Mar 2014 17:31:36 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.66.232 with SMTP id i8ls464888igt.32.gmail; Sat, 15 Mar
 2014 17:31:36 -0700 (PDT)
X-Received: by 10.66.20.10 with SMTP id j10mr17834880pae.11.1394929896145;
        Sat, 15 Mar 2014 17:31:36 -0700 (PDT)
Original-Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [2607:f8b0:400e:c03::235])
        by mx.google.com with ESMTPS id s3si8384836pbo.332.2014.03.15.17.31.36
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 15 Mar 2014 17:31:36 -0700 (PDT)
Received-SPF: pass (google.com: domain of schaub.johannes@googlemail.com designates 2607:f8b0:400e:c03::235 as permitted sender) client-ip=2607:f8b0:400e:c03::235;
Original-Received: by mail-pa0-f53.google.com with SMTP id ld10so4197999pab.12
        for <std-proposals@isocpp.org>; Sat, 15 Mar 2014 17:31:36 -0700 (PDT)
X-Received: by 10.66.146.229 with SMTP id tf5mr17754454pab.50.1394929896029;
 Sat, 15 Mar 2014 17:31:36 -0700 (PDT)
Original-Received: by 10.68.216.97 with HTTP; Sat, 15 Mar 2014 17:31:35 -0700 (PDT)
In-Reply-To: <CAOfiQq=-DRrjX2sAxpqPhhorg4ARW9q4vNA=D5k7wHzikjMiBg@mail.gmail.com>
X-Original-Sender: schaub.johannes@googlemail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of schaub.johannes@googlemail.com designates 2607:f8b0:400e:c03::235
 as permitted sender) smtp.mail=schaub.johannes@googlemail.com;
       dkim=pass header.i=@googlemail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:9825
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9825>

2014-03-16 1:17 GMT+01:00 Richard Smith <richard@metafoo.co.uk>:
> On Sat, Mar 15, 2014 at 5:13 PM, Johannes Schaub
> <schaub.johannes@googlemail.com> wrote:
>>
>> 2014-03-16 0:38 GMT+01:00 Richard Smith <richard@metafoo.co.uk>:
>> > On Sat, Mar 15, 2014 at 1:46 PM, Andrew Tomazos
>> > <andrewtomazos@gmail.com>
>> > wrote:
>> >>
>> >> Is the following supposed to be ill-formed according to the current
>> >> draft?
>> >>
>> >> template<class> constexpr auto X = 42;
>> >>
>> >> int main()
>> >> {
>> >>         static_assert(X<int> == 42, "");
>> >> }
>> >>
>> >>
>> >> [dcl.spec.auto]/4 says that auto is allowed when declaring variables in
>> >> namespace-scope, but doesn't explicitly say in variable templates -
>> >> consequently this is ill-formed.
>> >
>> >
>> > A specialization of a variable template is a variable, so this is
>> > allowed.
>> >
>>
>> I don't understand this reason. The following is not a specialization
>> of a variable template, is it?
>>
>>    template<class> constexpr auto X = 42;
>>
>> The Standard says in 7.1.6.4p6, "A program that uses auto or
>> decltype(auto) in a context not explicitly allowed in this section is
>> ill-formed."
>>
>> The section does not explicitly allow "auto" for variable templates.
>> Why does it matter that the specialization of that template is a
>> variable?
>
>
> Because the validity of a template isn't governed by the usual language
> rules. 14.6/8: "No diagnostic shall be issued for a template for which a
> valid specialization can be generated."
>

Thanks, I have never interpreted this sentence in that way. It just
sounds to me as a warning to prematurely rejecting compilers. IMO a
much better way to word this would be along the way of

   "A template that is made ill-formed by a rule not in this paragraph
is still well-formed as long as a valid specialization can be
generated for it."

As it is stated in the Standard, it sounds like the rule talks about
well-formed templates only.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
