public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54859] New: constexpr in template aliase rejected as non-constant
@ 2012-10-08 17:05 leonid at volnitsky dot com
  2012-10-08 17:26 ` [Bug c++/54859] [4.8 Regression] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: leonid at volnitsky dot com @ 2012-10-08 17:05 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54859
           Summary: constexpr in template aliase rejected as non-constant
    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


clang-3.2 and gcc-4.7.2 compiles,  gcc-4.8 rejects:

--------------------------------------------------------------------------
// enbale_if 
template <bool B, class T = void>    
struct enable_if  { typedef T type; }; 

template <class T>                   
struct enable_if<false, T>   {};

// template alias
template<bool Cnd, class T=void> 
using  eIF = typename enable_if <Cnd,T>::type;

// f  - this compiles
template<bool B=true> 
typename enable_if<!B, int>::type f() { return 20; }

// ff - error: integral expression ‘! B’ is not constant 
template<bool B=true> 
eIF<!B, int>  ff() { return 20; }

int main() {}
--------------------------------------------------------------------------- 

This seams to be related to bug 54648,  where I found bad commit to be 191412


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

* [Bug c++/54859] [4.8 Regression] constexpr in template aliase rejected as non-constant
  2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
@ 2012-10-08 17:26 ` jakub at gcc dot gnu.org
  2012-10-21 22:54 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-08 17:26 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-08
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.8.0
            Summary|constexpr in template       |[4.8 Regression] constexpr
                   |aliase rejected as          |in template aliase rejected
                   |non-constant                |as non-constant
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-08 17:25:42 UTC ---
Indeed, this started being rejected with
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191412 too.


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

* [Bug c++/54859] [4.8 Regression] constexpr in template aliase rejected as non-constant
  2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
  2012-10-08 17:26 ` [Bug c++/54859] [4.8 Regression] " jakub at gcc dot gnu.org
@ 2012-10-21 22:54 ` paolo.carlini at oracle dot com
  2012-11-08 15:08 ` [Bug c++/54859] [4.8 Regression] constexpr in template alias " redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-21 22:54 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lucdanton at free dot fr

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-21 22:53:21 UTC ---
*** Bug 54912 has been marked as a duplicate of this bug. ***


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

* [Bug c++/54859] [4.8 Regression] constexpr in template alias rejected as non-constant
  2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
  2012-10-08 17:26 ` [Bug c++/54859] [4.8 Regression] " jakub at gcc dot gnu.org
  2012-10-21 22:54 ` paolo.carlini at oracle dot com
@ 2012-11-08 15:08 ` redi at gcc dot gnu.org
  2012-11-09 16:08 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2012-11-08 15:08 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |redi at gcc dot gnu.org

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-11-08 15:08:15 UTC ---
template<unsigned N>
  using Num = int;

template<typename... Types>
  using Count = Num<sizeof...(Types)>;

Count<int, char, void> i;


This claims sizeof is not a constant:
e.C:5:37: error: integral expression 'sizeof (Types ...)' is not constant


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

* [Bug c++/54859] [4.8 Regression] constexpr in template alias rejected as non-constant
  2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
                   ` (2 preceding siblings ...)
  2012-11-08 15:08 ` [Bug c++/54859] [4.8 Regression] constexpr in template alias " redi at gcc dot gnu.org
@ 2012-11-09 16:08 ` jason at gcc dot gnu.org
  2012-11-09 16:15 ` jason at gcc dot gnu.org
  2012-11-09 18:24 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2012-11-09 16:08 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/54859] [4.8 Regression] constexpr in template alias rejected as non-constant
  2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
                   ` (3 preceding siblings ...)
  2012-11-09 16:08 ` jason at gcc dot gnu.org
@ 2012-11-09 16:15 ` jason at gcc dot gnu.org
  2012-11-09 18:24 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2012-11-09 16:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-11-09 16:14:56 UTC ---
Author: jason
Date: Fri Nov  9 16:14:48 2012
New Revision: 193368

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193368
Log:
    PR c++/54859
    * pt.c (check_instantiated_arg): Don't complain about dependent args.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-25.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/54859] [4.8 Regression] constexpr in template alias rejected as non-constant
  2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
                   ` (4 preceding siblings ...)
  2012-11-09 16:15 ` jason at gcc dot gnu.org
@ 2012-11-09 18:24 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-09 18:24 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|jason at gcc dot gnu.org    |
         Resolution|                            |FIXED

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-09 18:23:57 UTC ---
This is fixed then.


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

end of thread, other threads:[~2012-11-09 18:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-08 17:05 [Bug c++/54859] New: constexpr in template aliase rejected as non-constant leonid at volnitsky dot com
2012-10-08 17:26 ` [Bug c++/54859] [4.8 Regression] " jakub at gcc dot gnu.org
2012-10-21 22:54 ` paolo.carlini at oracle dot com
2012-11-08 15:08 ` [Bug c++/54859] [4.8 Regression] constexpr in template alias " redi at gcc dot gnu.org
2012-11-09 16:08 ` jason at gcc dot gnu.org
2012-11-09 16:15 ` jason at gcc dot gnu.org
2012-11-09 18:24 ` paolo.carlini at oracle dot com

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