From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19616 invoked by alias); 3 Jun 2010 14:53:26 -0000 Received: (qmail 19000 invoked by uid 48); 3 Jun 2010 14:53:00 -0000 Date: Thu, 03 Jun 2010 14:53:00 -0000 Subject: [Bug c++/44400] New: GCC allows declaring a function having the name of the class using a typedef X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "schaub-johannes at web dot de" 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: 2010-06/txt/msg00335.txt.bz2 This code is accepted by GCC and compiles typedef void F(); struct X { F X; }; Not valid according to 9.2/13bullet2. It seems that GCC thinks that "F X;" is a data-member (declaring data-members with the name of the class is valid, as long as there are no user declared constructors). -- Summary: GCC allows declaring a function having the name of the class using a typedef Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: schaub-johannes at web dot de GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44400