From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32645 invoked by alias); 20 Dec 2012 18:36:29 -0000 Received: (qmail 30153 invoked by uid 48); 20 Dec 2012 18:36:08 -0000 From: "leonid at volnitsky dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) Date: Thu, 20 Dec 2012 18:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: leonid at volnitsky dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg02034.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55766 Bug #: 55766 Summary: temlate alias is not equivalent (const-ness is not recognized) Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: leonid@volnitsky.com Created attachment 29016 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D29016 goog.ii I have following alias in my code: template=20=20 using eIF =3D typename std::enable_if ::type; I encountered code where alias is not equivalent to direct use of enable_if. Attached are good.ii (with enable_if) which both GCC480-20121220 and CLANG32 can compile, and bad.ii (with alias eIF), which only CLANG can compile.=20 diff good.ii bad.ii 80517c80517 < typename std::enable_if<(sizeof(Arg1),N=3D=3D1), Arg1>::type --- > eIF<(sizeof(Arg1),N=3D=3D1), Arg1> 80522c80522 < typename std::enable_if<(sizeof(Arg1),N=3D=3D2), Arg2>::type --- > eIF<(sizeof(Arg1), N=3D=3D2), Arg2> Comma op in expression (sizeof(Arg1),N=3D=3D1) used to makes templated memb= er function depend on Arg1 template argument (to trigger SFINAE).=20 Error message: lambda.h:45:2: error: integral expression =E2=80=98(0, false)=E2=80=99 is n= ot constant