The following should compile according to this DR report (but it is only in ready state so I am going to confirm it and then suspend it): class a {}; typename ::a f(); Also the following should not compile as a is not qualified then: class a {}; typename a f();
Confirmed, to ...
Suspend this as it only in the ready state.
Oh and I thought I saw a bug or two about this before.
Subject: Re: New: [DR 382] qualified names should allow typename keyword in front of it (even in non-templates) "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes: | The following should compile according to this DR report (but it is only in ready state so I am going to | confirm it and then suspend it): | class a {}; | typename ::a f(); | | Also the following should not compile as a is not qualified then: | class a {}; | typename a f(); If that is what the DR says, then the DR does not make any sense... -- Gaby
(In reply to comment #4) > If that is what the DR says, then the DR does not make any sense... Hey I am just reading what it says: <http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#382>. DR 468 is about allowing ::template outside of templates. I am not making this up.
Subject: Re: [DR 382] qualified names should allow typename keyword in front of it (even in non-templates) "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes: | ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-23 15:04 ------- | (In reply to comment #4) | > If that is what the DR says, then the DR does not make any sense... | Hey I am just reading what it says: | <http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#382>. | | DR 468 is about allowing ::template outside of templates. | | I am not making this up. I'm not saying you're making it up. It just strikes me that the new "subtlities" don't make much sense. -- Gaby
This was voted into WP at the October 2005 meeting.
I am going to work on this one.
I do have a correct patch which I will submit when stage1 comes around.
Andrew, update on this? Stage1 is closing soon...
(In reply to comment #10) > Andrew, update on this? Stage1 is closing soon... To some extent this is a bug fix so it can go while in stage3. I will try to get a patch going this weekend. Since I have to dig through the PS3 GCC sources, it is slightly harder but I should be able to find it easily.
Andrew, any news?
Subject: Bug 22154 Author: pinskia Date: Mon Jul 13 16:15:55 2009 New Revision: 149590 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149590 Log: 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/22154 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in front of qualified names. 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/22154 * g++.old-deja/g++.pt/typename10.C: Update for DR 382, typename in front of qualified names are allowed. * g++.dg/parse/crash10.C: Likewise. * g++.dg/parse/error15.C: Likewise. * g++.dg/parse/typename9.C: Likewise. * g++.dg/parse/error8.C: Likewise. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/parse/crash10.C trunk/gcc/testsuite/g++.dg/parse/error15.C trunk/gcc/testsuite/g++.dg/parse/error8.C trunk/gcc/testsuite/g++.dg/parse/typename9.C trunk/gcc/testsuite/g++.old-deja/g++.pt/typename10.C
Fixed.