This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54074] New: [C++0x] initializer list accepts incorrect nested input


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

             Bug #: 54074
           Summary: [C++0x] initializer list accepts incorrect nested
                    input
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ebeworld@gmail.com


#include<cstring>
#include<string>
using namespace std;

struct S1 {
    int i;
    string str;
};

//nested
struct S2 {
    int i;
    string str;
    S1 s1;
};

int main() {
        //should be S2 s22{ 3, "Hello3", {4,"Hello4"} }; 
        //but it compiles
    S2 s22{ 3, "Hello3", 4,"Hello4" };  
    FINISH_TEST();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]