https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104013
Bug ID: 104013 Summary: Constructor for std::vector<std::any> with single element initializer list defaults to length construction Product: gcc Version: 8.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: trekie10b at gmx dot de Target Milestone: --- std: c++17 The following code initializes a vector of int with one element (5): std::vector<int> vec_test_int = std::vector<int>({5}); The following code, however initializes the vector with 5 empty std::any objects: std::vector<std::any> vec_test_any = std::vector<std::any>({5}); As per the standard (ยง13.3.1.7), the initializer_list constructor overload of T (std::any) should take precedence over that of std::vector, as it does in the first case.