public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31730]  New: nested typedef to template of same name rejected
@ 2007-04-27 19:13 eric dot niebler at gmail dot com
  2007-04-27 19:17 ` [Bug c++/31730] " pinskia at gcc dot gnu dot org
  2007-04-27 20:24 ` eric dot niebler at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: eric dot niebler at gmail dot com @ 2007-04-27 19:13 UTC (permalink / raw)
  To: gcc-bugs

The following code should compile. With gcc 4.3 it does not.

   template<typename Iter> struct match_context { };

   template<typename BidIter>
   struct match_state
   {
     typedef match_context<BidIter> match_context;
   };


-- 
           Summary: nested typedef to template of same name rejected
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eric dot niebler at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31730


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/31730] nested typedef to template of same name rejected
  2007-04-27 19:13 [Bug c++/31730] New: nested typedef to template of same name rejected eric dot niebler at gmail dot com
@ 2007-04-27 19:17 ` pinskia at gcc dot gnu dot org
  2007-04-27 20:24 ` eric dot niebler at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-27 19:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-04-27 20:16 -------
No, the error message is correct.  You change the meaning of match_context in
the class.

Doing:
    typedef ::match_context<BidIter> match_context;

Fixes the source to be valid C++.  Note C++ does not really require a
diagnostic here (it is one of the invalid code that C++ does not require one).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31730


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/31730] nested typedef to template of same name rejected
  2007-04-27 19:13 [Bug c++/31730] New: nested typedef to template of same name rejected eric dot niebler at gmail dot com
  2007-04-27 19:17 ` [Bug c++/31730] " pinskia at gcc dot gnu dot org
@ 2007-04-27 20:24 ` eric dot niebler at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: eric dot niebler at gmail dot com @ 2007-04-27 20:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from eric dot niebler at gmail dot com  2007-04-27 21:24 -------
Yep, thanks. According to Doug Gregor, this case is covered in the first para
of
[basic.scope.class]. My bad.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31730


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-27 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-27 19:13 [Bug c++/31730] New: nested typedef to template of same name rejected eric dot niebler at gmail dot com
2007-04-27 19:17 ` [Bug c++/31730] " pinskia at gcc dot gnu dot org
2007-04-27 20:24 ` eric dot niebler at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).