Hi,
On 05/03/2014 11:14 PM, Jason Merrill wrote:
On 04/30/2014 05:15 AM, Paolo Carlini wrote:
decl = (CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl))
+ && uses_template_parms (DECL_CONTEXT (decl))
Do you want CLASSTYPE_IS_TEMPLATE here?
Uhm, you mean something simple like the attached? Because certainly I
tried it and didn't fully work (nsdmi-template7.C?) and for sure we
would regress on the below (which we should probably also add to
testsuite, I had it two days ago in my experiments...).
Thanks,
Paolo.
//////////////////////
Index: pt.c
===================================================================
--- pt.c (revision 210043)
+++ pt.c (working copy)
@@ -462,7 +462,7 @@ maybe_begin_member_template_processing (tree decl)
bool nsdmi = TREE_CODE (decl) == FIELD_DECL;
if (nsdmi)
- decl = (CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl))
+ decl = (CLASSTYPE_IS_TEMPLATE (DECL_CONTEXT (decl))
? CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (decl))
: NULL_TREE);
// PR c++/60999
// { dg-do compile { target c++11 } }
struct B
{
template<int N, int M>
struct A;
template<int M>
struct A<1, M>
{
int X = M;
};
};