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


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


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