This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: dynamic_cast<T>(v) fails for T qualified from global namespace
- To: ballan at c425089-a dot plstn1 dot sfba dot home dot com
- Subject: Re: dynamic_cast<T>(v) fails for T qualified from global namespace
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Fri, 31 Aug 2001 10:28:11 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- Organization: Codesourcery LLC
- References: <3B8EA08F.4D5F6E1B@c425089-a.plstn1.sfba.home.com>
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