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]

Re: G++ bug?


>>>>> "Alex" == Alex Larsson <alexl@redhat.com> writes:

This testcase was broken by Alexandre Oliva's recent initializer patch.

> Building fam with gcc 3.1 i stumbled upon this gem:
> struct FDInfo {
>   struct FDIOHandler {
>     void *closure;
>   } read, write;
> };

> struct IOTypeInfo {
>   FDInfo::FDIOHandler FDInfo::*const iotype;
>   IOTypeInfo(FDInfo::FDIOHandler FDInfo::* a_iotype) : iotype(a_iotype) {  
> }
> };

> IOTypeInfo foo (&FDInfo::read);


> It gives me:
> foo.c++:12: uninitialized const member `IOTypeInfo::iotype'

> But it worked in gcc 2.96, and i fail to see the problem. iotype is 
> clearly initialized.

> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander Larsson                                            Red Hat, Inc 
>                    alexl@redhat.com    alla@lysator.liu.se 
> He's a lounge-singing playboy senator She's a cynical motormouth former first 
> lady who dreams of becoming Elvis. They fight crime! 


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