Thread View: comp.std.c++
2 messages
2 total messages
Started by TABATA Tomohira
Mon, 29 Jan 1996 06:37
ambiguous typedef
Author: TABATA Tomohira
Date: Mon, 29 Jan 1996 06:37
Date: Mon, 29 Jan 1996 06:37
36 lines
1547 bytes
1547 bytes
Hi, there.
Can't I use this declaration successfully?
class T1 {
public:
typedef T1 myclass;
};
class T2 {
public:
typedef T2 myclass;
};
class T3 : public T1, T2 {
public:
typedef T3 myclass;
};
By gcc-2.7.1 this cannot be compiled because of "request for member
`myclass' is ambiguous" on the line "typedef T3 myclass;".
I cannot find description on this matter in DWP.
This quetion was indicated originally by
yamada@ch0sw001.bkc.ritsumei.ac.jp.
------
Tomohira Tabata loba@k2.t.u-tokyo.ac.jp
Department of Mathematical Engineering and Information Physics,
Faculty of Engineering, University of Tokyo, Japan
TEL: +81-3-3812-2111 ext. 6902 FAX: +81-3-5800-6969
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Re: ambiguous typedef
Author: Fergus Henderson
Date: Mon, 29 Jan 1996 16:05
Date: Mon, 29 Jan 1996 16:05
33 lines
1389 bytes
1389 bytes
TABATA Tomohira <loba@k2.t.u-tokyo.ac.jp> writes:
>Can't I use this declaration successfully?
> class T1 {
> public:
> typedef T1 myclass;
> };
> class T2 {
> public:
> typedef T2 myclass;
> };
> class T3 : public T1, T2 {
> public:
> typedef T3 myclass;
> };
That code is strictly conforming (i.e. perfectly legal).
>By gcc-2.7.1 this cannot be compiled because of "request for member
>`myclass' is ambiguous" on the line "typedef T3 myclass;".
This is a bug in gcc.
--
Fergus Henderson WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au PGP: finger fjh@128.250.37.3
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads