2003-06-15  Giovanni Bajo <giovannibajo@libero.it>

        PR c++/11097
        * pt.c (tsubst_decl): substitute also the DECL_NAME node of
        USING_DECL.

2003-06-15  Giovanni Bajo <giovannibajo@libero.it>

        PR c++/11097

        * g++.dg/other/error5.C: modified the error message
        * g++.dg/lookup/using8.C: new test

Index: pt.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.697
diff -c -w -r1.697 pt.c
*** pt.c        3 Jun 2003 13:01:43 -0000       1.697
--- pt.c        15 Jun 2003 14:42:38 -0000
***************
*** 6260,6265 ****
--- 6260,6267 ----
        r = copy_node (t);
        DECL_INITIAL (r)
          = tsubst_copy (DECL_INITIAL (t), args, complain, in_decl);
+       DECL_NAME (r)
+         = tsubst_copy (DECL_NAME (t), args, complain, in_decl);
        TREE_CHAIN (r) = NULL_TREE;
        }
        break;
*** error5old.C Sun Jun 15 16:53:13 2003
--- error5.C    Sun Jun 15 16:53:32 2003
***************
*** 7,13 ****
  };

  template <typename T> struct S2 : S<T> {
!       using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<T\\>" "" }
  };

  template struct S2<int>;  // { dg-error "instantiated" "" }
--- 7,13 ----
  };

  template <typename T> struct S2 : S<T> {
!       using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<int\\>" "" }
  };

  template struct S2<int>;  // { dg-error "instantiated" "" }


// { dg-do compile }
// Origin: Bill Clarke <llib at computer dot org>
// PR c++/11097: using declartion for a converter operator to a nested class
//  in a base type

template <typename T>
struct A
{
  struct Nested {};
  operator Nested*();
};

template <typename T>
struct B : A<T>
{
  using A<T>::operator typename A<T>::Nested*;
};

template struct B<int>;














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








