c++/10759: Invalid use of typename accepted

bangerth@dealii.org bangerth@dealii.org
Mon May 12 22:06:00 GMT 2003


>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:



More information about the Gcc-bugs mailing list