From 4707967613245903800
X-Google-Thread: f78e5,473009b7dc4fc05d
X-Google-NewGroupId: yes
X-Google-Attributes: gid7894ca11fe,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII
Received: by 10.68.6.70 with SMTP id y6mr1409pby.6.1319561969082;
        Tue, 25 Oct 2011 09:59:29 -0700 (PDT)
MIME-Version: 1.0
Path: p6ni351pbn.0!nntp.google.com!news2.google.com!news4.google.com!feeder.news-service.com!news.albasani.net!.POSTED!not-for-mail
From: =?ISO-8859-1?Q?Daniel_Kr=FCgler?=<daniel.kruegler@googlemail.com>
Newsgroups: comp.std.c++
Subject: Re: Defect report: integral-to-boolean conversion in converted   
   constant expressions
Date: Tue, 25 Oct 2011 09:59:26 -0700 (PDT)
Organization: A noiseless patient Spider
Lines: 36
Sender: std-cpp-request@vandevoorde.com
Approved: stephen.clamage@oracle.com
Message-ID: <j84bbh$kq7$2@dont-email.me>
References: <37779.10.0.7.178.1319061824.squirrel@webmail.secure.aluminati.net>
X-Trace: news.albasani.net 2vugsaOtdkBmcEoTnDGJTdCx+Cj//0cpuFVgnMxQR/2vnhgdml+7t6A3p069jNTKezreX0VSclNIX4kIQ1/b4g==
NNTP-Posting-Date: Tue, 25 Oct 2011 16:59:28 +0000 (UTC)
Injection-Info: news.albasani.net; logging-data="KO2ZitrKKwycH6MLGzZSnKerIYIXoTeq/95CoWQIrH1uH3YV++F6QWsXMnH836H1b12HTCftvbWAp5nPLy183scKazB1XGu9vczSfMtIdEDeP85iceJi0FkFOmSKZP3z"; mail-complaints-to="abuse@albasani.net"
X-Mailer: Perl5 Mail::Internet v2.05
X-Submission-Address: std-cpp-submit@vandevoorde.com
Cancel-Lock: sha1:FbJuuDxSeVYRoUr/PqISvVrGwOY=
X-Original-Date: Mon, 24 Oct 2011 20:38:57 +0200
Xref: news2.google.com comp.std.c++:2093
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Am 20.10.2011 00:24, schrieb Richard Smith:
>  Hi,
>
>  In both C++98 and C++11, the following code appears to be ill-formed:
>
>      template<bool b>    struct S {};
>      S<0>    s;
>
>  However, EDG, g++ and clang all accept it. The reason this is ill-formed is
>  that the non-type template argument is a converted constant expression of type
>  'bool' (see [temp.arg.nontype]p5), and the second conversion in the implicit
>  conversion sequence is a boolean conversion, which is not allowed in the
>  conversion for a converted constant expression (see [expr.const]p3).
>  Conversions in the other direction (from 'bool' to integer types) are
>  permitted here, since they're integral promotions.
>
>  Suggested resolution: In [expr.const]p3, add "boolean conversions from
>  integral or unscoped enumeration type other than narrowing conversions" to the
>  list of conversions allowed in a converted constant expression.

Forwarded to CWG.

It seems to me that the actual issue is, whether it is clear or not that
[conv.integral] p4 already implies what you are suggesting here.

Greetings from Bremen,

Daniel Kr�gler



-- 
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


