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: dynamic_cast<T>(v) fails for T qualified from global namespace


Ben Allan wrote:
> 
> The short program at end here produces error messages under both 2.95.3 and
> 3.x at
> http://www.codesourcery.com/gcc-compile.shtml
> I don't see anything in the c++ spec that disallows globally qualified
> class names for T in dynamic_cast<T>(v); .

> /usr/tmp/@19711.7.cc: In function `int main()':
>       /usr/tmp/@19711.7.cc:37: parse error before `[' token
>       /usr/tmp/@19711.7.cc:42: parse error before `[' token
> 
>   fp2 = dynamic_cast<::n1::foo *>(bp); // ! err
`<:' is a digraph for `[', so you effectively wrote
	dynamic_cast [ : n1 :: foo * > ( bp ) ;

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


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