From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2444 invoked by alias); 5 Oct 2008 06:50:16 -0000 Received: (qmail 1777 invoked by uid 48); 5 Oct 2008 06:48:52 -0000 Date: Sun, 05 Oct 2008 06:50:00 -0000 Subject: [Bug c++/37736] New: Problem with designated initializer and template X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "simartin at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg00344.txt.bz2 Opened from comment 4 in PR29727. The following valid snipped is rejected with the current mainline === template struct A { struct S { int X; }; static S a; }; template typename A::S A::a = { X : 1 }; void foo() { A<0>::a; } === because 'X' is not found in the designated initializer: [...] pr29727_valid.C:18: error: 'Y' was not declared in this scope pr29727_valid.C:18: error: 'B<0>::S' has no non-static data member named '' We get the same with 4.0.1, 4.2.1 and the 4.3 branch. I don't have any earlier version to check, so I don't know if this is a regression or not. With a non template class, the code is accepted. -- Summary: Problem with designated initializer and template Product: gcc Version: unknown Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: simartin at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37736