Bug 22154 - [DR 382] qualified names should allow typename keyword in front of it (even in non-templates)
Summary: [DR 382] qualified names should allow typename keyword in front of it (even i...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.5.0
Assignee: Andrew Pinski
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch, rejects-valid
Depends on:
Blocks: 4.4pending 37515
  Show dependency treegraph
 
Reported: 2005-06-23 04:27 UTC by Andrew Pinski
Modified: 2009-07-13 16:16 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 2.95.3 3.3.5 4.0.0
Last reconfirmed: 2005-11-11 16:40:28


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-06-23 04:27:18 UTC
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();
Comment 1 Andrew Pinski 2005-06-23 04:27:34 UTC
Confirmed, to ...
Comment 2 Andrew Pinski 2005-06-23 04:28:32 UTC
Suspend this as it only in the ready state.
Comment 3 Andrew Pinski 2005-06-23 05:05:34 UTC
Oh and I thought I saw a bug or two about this before.
Comment 4 Gabriel Dos Reis 2005-06-23 14:58:19 UTC
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
Comment 5 Andrew Pinski 2005-06-23 15:04:00 UTC
(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.
Comment 6 Gabriel Dos Reis 2005-06-23 18:13:33 UTC
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
Comment 7 Andrew Pinski 2005-11-11 16:40:28 UTC
This was voted into WP at the October 2005 meeting.
Comment 8 Andrew Pinski 2007-11-08 20:31:01 UTC
I am going to work on this one.
Comment 9 Andrew Pinski 2008-01-03 17:46:47 UTC
I do have a correct patch which I will submit when stage1 comes around.
Comment 10 Manuel López-Ibáñez 2008-08-13 10:30:47 UTC
Andrew, update on this? Stage1 is closing soon...
Comment 11 Andrew Pinski 2008-08-13 20:59:45 UTC
(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.
Comment 12 Paolo Bonzini 2009-05-15 10:08:05 UTC
Andrew, any news?
Comment 13 Andrew Pinski 2009-07-13 16:16:17 UTC
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

Comment 14 Andrew Pinski 2009-07-13 16:16:35 UTC
Fixed.