This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++] Unreviewed patches


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]