[Bug c++/56137] New: std::initializer_list accepts invalid designated initializers

andersk at mit dot edu gcc-bugzilla@gcc.gnu.org
Tue Jan 29 04:22:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56137

             Bug #: 56137
           Summary: std::initializer_list accepts invalid designated
                    initializers
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: andersk@mit.edu


The following initializers are incorrectly accepted by g++ -std=c++11
(4.7.2-19ubuntu1 and 4.8.0 20130121-0ubuntu1):

#include <vector>
std::vector<int> v = {.ignored_name = 1, .also_ignored_name = 2};

#include <initializer_list>
std::initializer_list<int> l = {.ignored_name = 1, .also_ignored_name = 2};



More information about the Gcc-bugs mailing list