This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] Unreviewed patches
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: Giovanni Bajo <giovannibajo at libero dot it>, gcc-patches at gcc dot gnu dot org
- Date: 10 Jan 2004 00:32:58 +0100
- Subject: Re: [C++] Unreviewed patches
- Organization: Integrable Solutions
- References: <012b01c3d55a$83d170e0$34b82997@bagio><3FFE970B.9010507@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com> writes:
| 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
I disagree. The 'D' in "D::K" is the injected class-name, and
is therefore equivalent to D<T>, and is dependent.
| time (looking in D and any non-dependent bases), and in this case we
| find nothing, so it is an error.
No, you cannot look into D, because it is dependent.
-- Gaby