public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50837] New: [c++0x] static_assert and constexpr in template class
@ 2011-10-23 15:29 trashyankes at wp dot pl
  2011-10-25  0:31 ` [Bug c++/50837] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: trashyankes at wp dot pl @ 2011-10-23 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50837
           Summary: [c++0x] static_assert and constexpr in template class
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: trashyankes@wp.pl
             Build: MinGW 4.6.0 20110210; MinGW 4.7.0 20110815


error: `'static constexpr bool z<T>::test_constexpr() [with T = int]' cannot
appear in a constant-expression`
adding `z<T>::` before `test_constexpr` fix it
------------------------------------------------------
template<class T>
struct z
{
    static constexpr bool test_constexpr()
    {
        return true;
    }
    static bool test()
    {
        static_assert(test_constexpr(), "test1");//error here
        return true;
    }
};
int main()
{
    z<int>::test();
}
------------------------------------------------------


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

end of thread, other threads:[~2011-11-10  2:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-23 15:29 [Bug c++/50837] New: [c++0x] static_assert and constexpr in template class trashyankes at wp dot pl
2011-10-25  0:31 ` [Bug c++/50837] " paolo.carlini at oracle dot com
2011-10-25  1:11 ` paolo.carlini at oracle dot com
2011-10-26  0:03 ` paolo.carlini at oracle dot com
2011-11-10  2:45 ` paolo at gcc dot gnu.org
2011-11-10  6:09 ` 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).