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]

Re: explicit not working with template


> As far as I know, the following shouldn't compile, because the explicit
> keyword should prevent the int being converted into type A.  The explicit
> keyword seems only to work when the constructor is not a template.

Thanks for your bug report. The mainline compiler (2.96 20000223
(experimental)) says

a.cc: In function `int main ()':
a.cc:7: conversion from `int' to non-scalar type `A' requested

so it appears the bug has been fixed.

Regards,
Martin

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