This is the mail archive of the
mailing list for the GCC project.
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
+ 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.
typedef int mytype;
template <class T> class B;
class C: public A
template <class T> friend class B;
template <class T> class 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))?