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;
}