[Bug c++/54074] New: [C++0x] initializer list accepts incorrect nested input
ebeworld at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 23 22:19:00 GMT 2012
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();
}
More information about the Gcc-bugs
mailing list