220 9823 <CANu6V4ViH09LeqDs_Vc2tivK97=6yThejGLJ6+m0dRx0Fu+vRQ@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:13:19 +0100
Lines: 43
Approved: news@gmane.org
Message-ID: <CANu6V4ViH09LeqDs_Vc2tivK97=6yThejGLJ6+m0dRx0Fu+vRQ@mail.gmail.com>
References: <ec829ec4-9d4e-4d5c-8673-a58d46fec41b@isocpp.org>
	<CAOfiQqkf4N3Pga8V7n6as-CBdWWGJeKh-0s8ONxsdpRtamo-Cg@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 1394928793 2577 80.91.229.3 (16 Mar 2014 00:13:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 16 Mar 2014 00:13:13 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCQPNCEZSQNBBIOZSOMQKGQEDOCEDLY@isocpp.org Sun Mar 16 01:13:24 2014
Return-path: <std-proposals+bncBCQPNCEZSQNBBIOZSOMQKGQEDOCEDLY@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+bncBCQPNCEZSQNBBIOZSOMQKGQEDOCEDLY@isocpp.org>)
	id 1WOyhf-00067i-EO
	for gclcip-std-proposals@m.gmane.org; Sun, 16 Mar 2014 01:13:23 +0100
Original-Received: by mail-pb0-f72.google.com with SMTP id jt11sf10188951pbb.3
        for <gclcip-std-proposals@m.gmane.org>; Sat, 15 Mar 2014 17:13:22 -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=cnOb1fpYYOZTahpf2wy0tnpulw+npWnEE7GRthYMYFg=;
        b=zOdXdzNHV1XfCYdg9wvK1EiSY81V9oonMq82FjoQDQzSNPUbjGhb0AY9NUjqym/CxX
         ftmDe390osfoLNRghBbcSjQKndw1usMxE6LKcRPzupEJm8Ay3xobhHzaiBtq6oqKgFUC
         M1MCnONPGupuA3zkNWnqnF4fG4cqYgrfbKqSdraR6OjCQZ4sVHgpoZoLpyth9aCMQbV/
         3omei/x2rdS7a5aMN54KG4rq9ECzOQ0Tod1dPNlbmVoUPgMdbK9Xw4D7qN7Cxhy2tq0b
         kG+q+3EgfkLFeubavgi/pkvD9kFx4KQy6LDY5D8Bbz45ENbeRwHvFP7gzZ6MiIaNiMvB
         7MdQ==
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=cnOb1fpYYOZTahpf2wy0tnpulw+npWnEE7GRthYMYFg=;
        b=NVbDujfXwWr1bY541vMfKP11F7iAG8eY9RTUw8x+mrByCoxRWsjrde3uh2rmp58Cwb
         xZdRi4PpFk2FkbDRxbw3uCrSUZVGlR4ImHvueUzdV/2D0DFIsYcm/Ez0csd8F4qWjorx
         q6gPw6zRTuUs14jpl/Y477hTS6PG9xBuwQrwh6Hp6q+sehIq87YIYDhED6u+JmBA2kvt
         6w3fU8ov+uO4+cCZiDmqVpQhhXS3h4Y5lLhdY8nYj9mdALqDeKzBmxTqvW+ZYE+TAt/3
         m56GzqfcNt/cg77vs6ovJ3MoZVQQNX+st9vXQS2PMXaSO00ihn9L+tnE0FlLIiepMCWy
         Ovbg==
X-Gm-Message-State: ALoCoQl/TRSF+tZ8xK/PaXVc0F8UsyzFN3b5H5h6BYFI/wpVh5do67Ha5ATcX/Exl8TnH91kHQcC
X-Received: by 10.66.142.131 with SMTP id rw3mr6188366pab.18.1394928802306;
        Sat, 15 Mar 2014 17:13:22 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.43.167 with SMTP id x7ls358026igl.28.canary; Sat, 15 Mar
 2014 17:13:20 -0700 (PDT)
X-Received: by 10.68.215.68 with SMTP id og4mr17290066pbc.112.1394928800722;
        Sat, 15 Mar 2014 17:13:20 -0700 (PDT)
Original-Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [2607:f8b0:400e:c01::229])
        by mx.google.com with ESMTPS id gr2si6826188pac.406.2014.03.15.17.13.19
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 15 Mar 2014 17:13:19 -0700 (PDT)
Received-SPF: pass (google.com: domain of schaub.johannes@googlemail.com designates 2607:f8b0:400e:c01::229 as permitted sender) client-ip=2607:f8b0:400e:c01::229;
Original-Received: by mail-pb0-f41.google.com with SMTP id jt11so4163431pbb.14
        for <std-proposals@isocpp.org>; Sat, 15 Mar 2014 17:13:19 -0700 (PDT)
X-Received: by 10.67.5.131 with SMTP id cm3mr17624360pad.92.1394928799630;
 Sat, 15 Mar 2014 17:13:19 -0700 (PDT)
Original-Received: by 10.68.216.97 with HTTP; Sat, 15 Mar 2014 17:13:19 -0700 (PDT)
In-Reply-To: <CAOfiQqkf4N3Pga8V7n6as-CBdWWGJeKh-0s8ONxsdpRtamo-Cg@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:c01::229
 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:9823
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9823>

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?

-- 

--- 
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/.

.
