From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16974 invoked by alias); 23 Aug 2002 13:36:02 -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 16919 invoked by uid 71); 23 Aug 2002 13:36:01 -0000 Resent-Date: 23 Aug 2002 13:36:01 -0000 Resent-Message-ID: <20020823133601.16918.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, rob@mve.com Received: (qmail 15115 invoked by uid 61); 23 Aug 2002 13:28:36 -0000 Message-Id: <20020823132836.15114.qmail@sources.redhat.com> Date: Fri, 23 Aug 2002 06:36:00 -0000 From: rob@mve.com Reply-To: rob@mve.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7699: Inner class scopting not working correctly for function prototype matching X-SW-Source: 2002-08/txt/msg00490.txt.bz2 List-Id: >Number: 7699 >Category: c++ >Synopsis: Inner class scopting not working correctly for function prototype matching >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Aug 23 06:36:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: rob@mve.com >Release: gcc 3.1 >Organization: >Environment: Red Hat Linux 7.3 on x86 Dual P4 Xeon 2.4 GHz Linux version 2.4.18-5smp (bhcompile@daffy.perf.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)) #1 SMP Mon Jun 10 15:19:40 EDT 2002 >Description: With multiple levels of inner (nested) classes within an outer class template, attempting to return an instance of one inner class from a member function of an inner, inner class causes a compilation failure with a series of related errors. There is a failure to match function prototypes even though one of the candidates listed is identical to that requested, and all class names have been fully scoped. In the example file attached the member function of a second degree inner class is attempting to return an object of a first degree inner class, all of which are in the same outer class template. Example class layout: template class A { class B { }; class C { class D { A::B operator*(); // Member function declaration }; }; }; template A::B A::C::D::operator*() // Causes errors { return A::B(); } Note that the same source code provided in the attached file works perfectly with the SGI MipPro C++ compiler. The attached file contains the example on which I discovered the issue. The same problem occurs twice in this code. The errors reported on my system are: In file included from main.cxx:8: /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1373: prototype for `Grid2D::PointReference Grid2D::FaceReference::VertexCirculator::operator*()' does not match any in class `Grid2D::FaceReference::VertexCirculator' /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:257: candidate s are: Point Grid2D::FaceReference::VertexCirculator::operator*() const /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:256: Grid2D::PointReference Grid2D::FaceReference::VertexCirculator::operator*() /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1373: template definition of non-template `Grid2D::PointReference Grid2D::FaceReference::VertexCirculator::operator*()' /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1453: prototype for `Grid2D::EdgeReference Grid2D::FaceReference::EdgeCirculator::operator*()' does not match any in class `Grid2D::FaceReference::EdgeCirculator' /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:287: candidate s are: Edge Grid2D::FaceReference::EdgeCirculator::operator*() const /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:286: Grid2D::EdgeReference Grid2D::FaceReference::EdgeCirculator::operator*() /homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1453: template definition of non-template `Grid2D::EdgeReference Grid2D::FaceReference::EdgeCirculator::operator*()' >How-To-Repeat: The following command line reproduces the error : /usr/local/gcc3.1/bin/g++ -fPIC -ftemplate-depth-50 -Wno-deprecated -g -DMVE_DEBUG -DMVE_LINUX -DMVE_WFM -DMVE_NM -DMVE_QT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DMVE_CGAL -DMVE_USE_CGAL -DDEBUG -DMVE_BOOST -DMVE_BOOST_VERSION=1280 -DMVE_LINUX_GCC3 -DMVE_STD -I. -I/homes/rob/dev/products/nmove/main -I/homes/rob/utils_install/LINUX/qt-3.0.3-LINUX.DEBUG.GCC3/include -I/homes/rob/utils_install/LINUX/cgal-2.4-LINUX.DEBUG.GCC3/include/CGAL/config/i686_Linux-2.4.18-5smp_g++-3.1.0 -I/homes/rob/utils_install/LINUX/cgal-2.4-LINUX.DEBUG.GCC3/include -I/homes/rob/utils_install/LINUX/boost-1_28_0-LINUX.DEBUG.GCC3 -c main.cxx -o obj_files/LINUX.DEBUG.GCC3/main.o >Fix: None found >Release-Note: >Audit-Trail: >Unformatted: