public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: rob@mve.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/7699: Inner class scopting not working correctly for function prototype matching
Date: Fri, 23 Aug 2002 06:36:00 -0000	[thread overview]
Message-ID: <20020823132836.15114.qmail@sources.redhat.com> (raw)


>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 <typename N>
class A
{
  class B
  {
  };

  class C
  {
    class D
    {
       A<N>::B operator*(); // Member function declaration
    };
  };
};

template <typename N>
A<N>::B A<N>::C::D::operator*() // Causes errors
{
   return A<N>::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<N>::PointReference
   Grid2D<N>::FaceReference::VertexCirculator::operator*()' does not match any
   in class `Grid2D<N>::FaceReference::VertexCirculator'
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:257: candidate
   s are: Point<N> Grid2D<N>::FaceReference::VertexCirculator::operator*()
   const
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:256:
         Grid2D<N>::PointReference
   Grid2D<N>::FaceReference::VertexCirculator::operator*()
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1373: template
   definition of non-template `Grid2D<N>::PointReference
   Grid2D<N>::FaceReference::VertexCirculator::operator*()'
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1453: prototype
   for `Grid2D<N>::EdgeReference
   Grid2D<N>::FaceReference::EdgeCirculator::operator*()' does not match any in
   class `Grid2D<N>::FaceReference::EdgeCirculator'
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:287: candidate
   s are: Edge<N> Grid2D<N>::FaceReference::EdgeCirculator::operator*() const
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:286:
         Grid2D<N>::EdgeReference
   Grid2D<N>::FaceReference::EdgeCirculator::operator*()
/homes/rob/dev/products/nmove/main/model/egs/grid2d/inc/Grid2D.h:1453: template
   definition of non-template `Grid2D<N>::EdgeReference
   Grid2D<N>::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:


             reply	other threads:[~2002-08-23 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-23  6:36 rob [this message]
2002-09-13  9:48 lerdsuwa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020823132836.15114.qmail@sources.redhat.com \
    --to=rob@mve.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).