public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104567] New: SFINAE check failure starting gcc 4.7.1 and up with -std=c++11
@ 2022-02-16 14:45 armenchik at mail dot ru
  2022-02-16 22:53 ` [Bug c++/104567] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: armenchik at mail dot ru @ 2022-02-16 14:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104567

            Bug ID: 104567
           Summary: SFINAE check failure starting gcc 4.7.1 and up with
                    -std=c++11
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: armenchik at mail dot ru
  Target Milestone: ---

template <typename _TAny, char const* value = _TAny::param>
constexpr bool has_char_static_param(int)
    { return true; }

template <typename _TAny>
constexpr bool has_char_static_param(...)
    { return false; }

struct checked_type
{
    constexpr static char param[] = "param"; // <- everything works fine
    //constexpr static int param = 0; // <- sfinae works fine, fails static
assert
    //int param; // <- sfinae fails! reporting error during param substitution
    //char const* param; // <- sfinae fails again as above
};

int main()
{
    static_assert(has_char_static_param<checked_type>(0), "check failed");
    return 0;
}

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

end of thread, other threads:[~2022-02-17 10:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 14:45 [Bug c++/104567] New: SFINAE check failure starting gcc 4.7.1 and up with -std=c++11 armenchik at mail dot ru
2022-02-16 22:53 ` [Bug c++/104567] " pinskia at gcc dot gnu.org
2022-02-16 22:58 ` [Bug c++/104567] SFINAE check failure with trying to access member field pinskia at gcc dot gnu.org
2022-02-16 23:03 ` pinskia at gcc dot gnu.org
2022-02-17 10:38 ` [Bug c++/104567] SFINAE check failure with trying to access member field on the default template argument for a function redi at gcc dot gnu.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).