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:
Jason Merrill a Ãcrit :
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?

Ah, I did this as a stop gap measure because otherwise for a non-dependent typedef variant, the compiler was crashing in tree gen_args = tsubst (DECL_TI_ARGS (decl), args, complain, in_decl);


I should have investigated. Earlier. Now it seems it is crashing eventualy in tsusbt () because of the assert gcc_assert (TREE_VEC_LENGTH (args) > 0); around line 9060. This is because we are trying to tsubst a TEMPLATE_PARM_INDEX with a NULL args parameter.

A non-dependent typedef doesn't have the same template args as its containing class? Why isn't the call to push_template_decl from grokfield setting that up properly?


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

Now I guess in this particular case, the right TYPE_BINFO to pass to enforce_access() would be the one of the C type, in C::mytype. If that is correct then how can I have access to that C type from within tsubst() when I am tsubsting mytype, which TYPE_DECL points to the declaration "typedef int mytype;" from class A ?

The issue is that we need to remember how the name was accessed, not just which name was used. Perhaps using TYPENAME_TYPE to express this would work.


Jason


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