This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54074] New: [C++0x] initializer list accepts incorrect nested input
- From: "ebeworld at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jul 2012 22:19:36 +0000
- Subject: [Bug c++/54074] New: [C++0x] initializer list accepts incorrect nested input
- Auto-submitted: auto-generated
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();
}