public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized)
@ 2012-12-20 18:36 leonid at volnitsky dot com
  2012-12-20 18:37 ` [Bug c++/55766] " leonid at volnitsky dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: leonid at volnitsky dot com @ 2012-12-20 18:36 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

             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=29016
goog.ii

I have following alias in my code:

    template<bool Cnd, class T=void>  
    using  eIF = typename std::enable_if <Cnd,T>::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. 


    diff good.ii bad.ii

    80517c80517
    <   typename std::enable_if<(sizeof(Arg1),N==1), Arg1>::type
    ---
    >   eIF<(sizeof(Arg1),N==1), Arg1>
    80522c80522
    <   typename std::enable_if<(sizeof(Arg1),N==2), Arg2>::type
    ---
    >   eIF<(sizeof(Arg1), N==2), Arg2>

Comma op in expression (sizeof(Arg1),N==1) used to makes templated member
function depend on Arg1 template argument (to trigger SFINAE). 

Error message:

lambda.h:45:2: error: integral expression ‘(0, false)’ is not constant


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/55766] temlate alias is not equivalent (const-ness is not recognized)
  2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
@ 2012-12-20 18:37 ` leonid at volnitsky dot com
  2012-12-20 18:58 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: leonid at volnitsky dot com @ 2012-12-20 18:37 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

--- Comment #1 from Leonid Volnitsky <leonid at volnitsky dot com> 2012-12-20 18:37:19 UTC ---
Created attachment 29017
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29017
bad.ii


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/55766] temlate alias is not equivalent (const-ness is not recognized)
  2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
  2012-12-20 18:37 ` [Bug c++/55766] " leonid at volnitsky dot com
@ 2012-12-20 18:58 ` paolo.carlini at oracle dot com
  2012-12-20 23:47 ` [Bug c++/55766] template " daniel.kruegler at googlemail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-20 18:58 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dodji at gcc dot gnu.org

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-20 18:58:11 UTC ---
Dodji, can you have a look to this?

For the future, Leonid, please do your best to minimize the testcase (in 99.99%
of the cases, 10-20 lines are enough to show the problem)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/55766] template alias is not equivalent (const-ness is not recognized)
  2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
  2012-12-20 18:37 ` [Bug c++/55766] " leonid at volnitsky dot com
  2012-12-20 18:58 ` paolo.carlini at oracle dot com
@ 2012-12-20 23:47 ` daniel.kruegler at googlemail dot com
  2012-12-21  5:32 ` leonid at volnitsky dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-12-20 23:47 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-12-20 23:47:16 UTC ---
Looks like a dup of bug 55663 to me


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/55766] template alias is not equivalent (const-ness is not recognized)
  2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
                   ` (2 preceding siblings ...)
  2012-12-20 23:47 ` [Bug c++/55766] template " daniel.kruegler at googlemail dot com
@ 2012-12-21  5:32 ` leonid at volnitsky dot com
  2012-12-21  9:48 ` paolo.carlini at oracle dot com
  2012-12-23 17:01 ` dodji at seketeli dot org
  5 siblings, 0 replies; 7+ messages in thread
From: leonid at volnitsky dot com @ 2012-12-21  5:32 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

--- Comment #4 from Leonid Volnitsky <leonid at volnitsky dot com> 2012-12-21 05:32:23 UTC ---
And as I just found, dup of bug 54648 too, which I reported on 2012-09 and
found bad commit.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/55766] template alias is not equivalent (const-ness is not recognized)
  2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
                   ` (3 preceding siblings ...)
  2012-12-21  5:32 ` leonid at volnitsky dot com
@ 2012-12-21  9:48 ` paolo.carlini at oracle dot com
  2012-12-23 17:01 ` dodji at seketeli dot org
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-21  9:48 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-21 09:47:50 UTC ---
Dup.

*** This bug has been marked as a duplicate of bug 55663 ***


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/55766] template alias is not equivalent (const-ness is not recognized)
  2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
                   ` (4 preceding siblings ...)
  2012-12-21  9:48 ` paolo.carlini at oracle dot com
@ 2012-12-23 17:01 ` dodji at seketeli dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at seketeli dot org @ 2012-12-23 17:01 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55766

--- Comment #6 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-12-23 17:01:11 UTC ---
"paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org> a écrit:

> Dodji, can you have a look to this?

Sure, I am looking at it and will be posting comments to PR c++/55663
instead, as this bug is a duplicate of that one.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-23 17:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20 18:36 [Bug c++/55766] New: temlate alias is not equivalent (const-ness is not recognized) leonid at volnitsky dot com
2012-12-20 18:37 ` [Bug c++/55766] " leonid at volnitsky dot com
2012-12-20 18:58 ` paolo.carlini at oracle dot com
2012-12-20 23:47 ` [Bug c++/55766] template " daniel.kruegler at googlemail dot com
2012-12-21  5:32 ` leonid at volnitsky dot com
2012-12-21  9:48 ` paolo.carlini at oracle dot com
2012-12-23 17:01 ` dodji at seketeli dot org

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).