[Bug c++/49205] New: Default constructor with pack expansion parameter not detected
schaub.johannes at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Sat May 28 00:48:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49205
Summary: Default constructor with pack expansion parameter not
detected
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
This is rejected as "ambiguous" by GCC:
struct A {
template<typename ...T> A(T...);
A(initializer_list<short>);
A(initializer_list<long>);
};
A a{};
But in fact, 8.5.4p3:
"If the initializer list has no elements and T is a class type with a default
constructor, the object is value-initialized."
And 12.1p5:
"A default constructor for a class X is a constructor of class X that can be
called without an argument."
So, there is no ambiguity. The default ctor is called, and "T" is deduced to
"<>"(empty pack).
More information about the Gcc-bugs
mailing list