public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10759: Invalid use of typename accepted
@ 2003-05-12 21:36 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-05-12 21:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10759
>Category:       c++
>Synopsis:       Invalid use of typename accepted
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 12 21:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
all versions up to today's CVS
>Description:
I think the use of "typename" in the last line is
bogus, yet it is accepted by all versions of gcc:
-------------------------------------
namespace NS {
  template <typename T> class C;
}

template <typename T> struct X {
    NS::C<T> foo ();
};

template <typename T>
typename NS::C<T> X<T>::foo () {}
----------------------------------

Note that this stops to be accepted once I move C out of
namespace NS, but that shouldn't really matter. Irritatingly,
icc has the same bug, so I found this just by accident...

W.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread
* Re: c++/10759: Invalid use of typename accepted
@ 2003-05-13 11:34 giovannibajo
  0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo @ 2003-05-13 11:34 UTC (permalink / raw)
  To: bangerth, gcc-bugs, gcc-prs, nobody

Synopsis: Invalid use of typename accepted

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Tue May 13 11:32:52 2003
State-Changed-Why:
    Not a bug IMO. 'typename' can be used anywhere within a
    template definition, as long as it refers to a qualified
    name which names a type. It's required only if the name
    is dependent, but it is accepted even if it is not. In your
    case, NS::C<T> is a qualified non-dependent name within a
    template definition so it can be preponed with 'typename'.
    If you move C<> out of NS, you remove the qualification.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10759


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

end of thread, other threads:[~2003-05-13 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-12 21:36 c++/10759: Invalid use of typename accepted bangerth
2003-05-13 11:34 giovannibajo

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).