https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70637
Bug ID: 70637 Summary: Ambiguity error invoking a constructor with double brace initialization Product: gcc Version: 5.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: steveire at gmail dot com Target Milestone: --- $ g++ --version g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ double-braces.cpp -std=c++11 double-braces.cpp: In function ‘int main()’: double-braces.cpp:16:20: error: call of overloaded ‘SomeClass(<brace-enclosed initializer list>)’ is ambiguous SomeClass sc({{}}); ^ double-braces.cpp:7:12: note: candidate: SomeClass::SomeClass(std::vector<std::vector<float> >) explicit SomeClass(std::vector<std::vector<float>> samples) ^ double-braces.cpp:4:7: note: candidate: SomeClass::SomeClass(const SomeClass&) class SomeClass ^ double-braces.cpp:4:7: note: candidate: SomeClass::SomeClass(SomeClass&&) $ cat double-braces.cpp #include <vector> class SomeClass { public: explicit SomeClass(std::vector<std::vector<float>> samples) : mSamples(std::move(samples)) { } std::vector<std::vector<float>> mSamples; }; int main() { SomeClass sc({{}}); }