http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54835
Bug #: 54835
Summary: [C++11] Explicit default constructors not respected
during copy-list-initialization
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
gcc 4.8.0 20120930 (experimental) with the compiler flags
-Wall -pedantic -std=c++11
accepts the following copy-list-initialization of a class type with an explicit
default constructor:
//-------------------------
struct S {
explicit S(int = 0) {}
};
S s = {};
//-------------------------
This code should be ill-formed, because it is ruled out by [over.match.list],
in particular by the unconditional wording:
"In copy-list-initialization, if an explicit constructor is chosen, the
initialization is ill-formed."