From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7696 invoked by alias); 26 Oct 2002 14:47:09 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7647 invoked by uid 61); 26 Oct 2002 14:47:08 -0000 Date: Sat, 26 Oct 2002 07:47:00 -0000 Message-ID: <20021026144708.7642.qmail@sources.redhat.com> To: ben@timing.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: lerdsuwa@gcc.gnu.org Reply-To: lerdsuwa@gcc.gnu.org, ben@timing.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/7467: method & class w/same name gives unhelpful error. X-SW-Source: 2002-10/txt/msg01085.txt.bz2 List-Id: Synopsis: method & class w/same name gives unhelpful error. State-Changed-From-To: open->closed State-Changed-By: lerdsuwa State-Changed-When: Sat Oct 26 07:47:07 2002 State-Changed-Why: Not a bug. The following is a correct version of your code. First, you need to declare the class foo before using it. Second, to distinguish between class foo and function foo, you can use the scope operator "::". #include class foo { public: foo() {}; }; class A { public: A() {}; void foo() {}; ::foo bar; }; int main() { A oink; // gives same error as: // B oink; // (B not defn'd) } http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7467