https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70563
Martin Sebor changed:
What|Removed |Added
Keywords||rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed||2016-06-16
CC||msebor at gcc dot gnu.org
Summary|SFINEA fails when trying|SFINAE fails when trying
|invalid template|invalid template
|instantiation |instantiation
Ever confirmed|0 |1
Known to fail||4.9.3, 5.3.0, 6.1.0, 7.0
--- Comment #1 from Martin Sebor ---
I'm not 100% sure the code is valid but I can't find anything wrong with it and
I don't think the error message is correct. The type it complains about being
incomplete seems complete to me. I'm going to confirm this with the slightly
reduced test case that should also make clear which type is being instantiated
by which expression. I note that Clang 3.8 does compile it as mentioned,
though EDG eccp does not (though the error it issues suggests it's confused by
the complicated templates).
All recent versions of GCC fail to compile the test case, although 4.9.3 with a
different error: ‘b’ is not a member of ‘C::CC >’.
$ cat u.C && /home/msebor/build/gcc-trunk-svn/gcc/xgcc -B
/home/msebor/build/gcc-trunk-svn/gcc -Wall -Wextra -Wpedantic u.C
template using A = void;
template struct B { };
template class T> struct C
{
template >
struct CC { enum { b = 0 }; };
template class U, class... Ts>
struct CC, A > > { enum { a = 1 }; };
};
template struct D { };
template struct E { };
enum {
a = C::CC>::a,
b = C::CC>::b
};
u.C:19:7: error: incomplete type ‘C::CC >’ used in nested name
specifier
b = C::CC>::b
^~~~