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

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