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: [PATCH] PR c++/26693


Dodji Seketeli wrote:
-	  && uses_template_parms (DECL_CONTEXT (decl)))
+	  && uses_template_parms (DECL_CONTEXT (decl))
+	  && uses_template_parms (decl))

This seems wrong. Why wouldn't we want to re-use typedefs with non-dependent types?


+	      if (!enforce_access (TYPE_BINFO (DECL_CONTEXT (decl)), decl, decl))
+		return error_mark_node;

It occurs to me that just using TYPE_BINFO (DECL_CONTEXT (decl)) may not be enough for code that accesses a typedef through a derived class, i.e.


class A
{
 protected:
  typedef int mytype;
};

template <class T> class B;

class C: public A
{
  template <class T> friend class B;
};

template <class T> class B
{
  C::mytype mem;
};

B<int> b;

This is valid, but I believe your patch will cause us to reject it, which would be a regression.

+ name = TYPE_IDENTIFIER (TREE_TYPE (TYPE_MAIN_DECL (type)));

Is this different from TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (type))?


Jason


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