[Bug c++/78065] incorrect behavior with std::is_same with nested class in a template class
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 21 13:46:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78065
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|libstdc++ |c++
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This isn't a libstdc++ problem, the definition is is_same is correct.
template<typename T, typename U> struct is_same { enum { value = 0 }; };
template<typename T> struct is_same<T, T> { enum { value = 1 }; };
template<typename T>
struct foo
{
using sub = struct some_struct;
};
template<typename T>
struct bar
{
using sub = struct some_struct { };
};
int main()
{
static_assert(is_same<foo<int>::sub, foo<double>::sub>::value, "should not
pass");
static_assert(is_same<bar<int>::sub, bar<double>::sub>::value, "should not
pass");
}
Passes with EDG, fails with GCC (and Clang).
More information about the Gcc-bugs
mailing list