This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] Unreviewed patches
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 09 Jan 2004 11:56:59 +0000
- Subject: Re: [C++] Unreviewed patches
- Organization: Codesourcery LLC
- References: <012b01c3d55a$83d170e0$34b82997@bagio>
Giovanni Bajo wrote:
Hello,
Allow 'template' within non dependent nested-specifiers:
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01698.html
A little bit of DR224
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01722.html
They both fix regressions on mainline. About the latter, I have some doubts
about its correctness mainly because there is a part of DR224 which is not
totally clear. Basically, should this be accepted?
------------------------------------
struct B {
typedef int K;
};
template <class T> struct D : T {
typedef typename D::K K2;
};
------------------------------------
I do not think this is valid. IIU 224 correctly, the nested-name-specifier
(which is D) is not dependent, therefore we do the lookup and definition
time (looking in D and any non-dependent bases), and in this case we
find nothing, so it is an error.
In addition, as D is non-dependent, the typename keyword should not be there.
But IIRC there is/may be a DR about relaxing the typename rule. Originally
it was either needed or not-allowed, there was no overlap. If DR224 is
implemented, without relaxing the typename rule, a lot of code will become
ill-formed. See DR409.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk