This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/5658: Regression on redefinition of a type in a derived class.



>Number:         5658
>Category:       c++
>Synopsis:       Regression on redefinition of a type in a derived class.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 11 11:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Theodore Papadopoulo
>Release:        unknown-1.0
>Organization:
>Environment:
i686-pc-linux-gnu
Linux 2.2.18
>Description:
This is a regression from 3.0 or gcc version 3.1 20011022.
The following minimal example now fails to compile.
This might be related to the correction of C++ bug 72.

What is really strange is that if the constructor for B is removed, then everything is compiling again. 

vanuatu->g++ TemplateInheritance.C 
TemplateInheritance.C: In instantiation of `B<T>::B() [with T = int]':
TemplateInheritance.C:18:   instantiated from here
TemplateInheritance.C:14: declaration of `template<class U> struct 
   B<int>::iterator'
TemplateInheritance.C:12: conflicts with previous declaration `template<class 
   U> struct B<int>::iterator'
TemplateInheritance.C:14: declaration of `template<class U> struct 
   B<int>::iterator'
TemplateInheritance.C:12: conflicts with previous declaration `template<class 
   U> struct B<int>::iterator'
TemplateInheritance.C:14: declaration of `template<class U> struct 
   B<int>::iterator'
TemplateInheritance.C:12: conflicts with previous declaration `template<class 
   U> struct B<int>::iterator'
>How-To-Repeat:
Just compile the program above with a recent compiler.
>Fix:
I did not find one, that is why I believe the problem is serious.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="TemplateInheritance.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="TemplateInheritance.C"

Ly8gQnVpbGQgZG9uJ3QgbGluazoKCi8vIENvcHlyaWdodCAoQykgMjAwMiBGcmVlIFNvZnR3YXJl
IEZvdW5kYXRpb24sIEluYy4KLy8gQ29udHJpYnV0ZWQgYnkgVGhlb2RvcmUuUGFwYWRvcG91bG8g
MTEgRmViIDIwMDIgPFRoZW9kb3JlLlBhcGFkb3BvdWxvQHNvcGhpYS5pbnJpYS5mcj4KCnN0cnVj
dCBBIHsKICAgIHR5cGVkZWYgaW50IGl0ZXJhdG9yOwp9Owp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4K
c3RydWN0IEI6IHB1YmxpYyBBIHsKICAgIHRlbXBsYXRlIDx0eXBlbmFtZSBVPgogICAgc3RydWN0
IGl0ZXJhdG9yIHsKICAgIH07CiAgICBCKCkgeyB9Cn07CmludCBtYWluKCkgCnsKICAgIEI8aW50
PiBhOyAKfTsK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]