This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78966] New: Unjustified variadic template instantiation
- From: "gcc-bugzilla at contacts dot eelis.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Jan 2017 16:25:58 +0000
- Subject: [Bug c++/78966] New: Unjustified variadic template instantiation
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78966
Bug ID: 78966
Summary: Unjustified variadic template instantiation
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc-bugzilla at contacts dot eelis.net
Target Milestone: ---
Consider:
template<typename... TT>
struct vari
{
static_assert(sizeof...(TT) != 0, "bleh");
};
template<typename> struct X {};
void f(void(*)(X<char>));
template<typename... T> void f(vari<T...>);
// if this line is commented out, code compiles fine
template<typename T> void g(X<T>);
void h() { f(g); }
When compiled with gcc 7.0.0 20161219, the static assert triggers:
prog.cc: In instantiation of 'struct vari<>':
prog.cc:16:15: required from here
prog.cc:4:3: error: static assertion failed: bleh
static_assert(sizeof...(TT) != 0, "bleh");
But there's no reason for vari to be instantiated without arguments here, is
there?