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: [C++ Patch] PR 60999


Hi again,

On 05/05/2014 10:48 PM, Jason Merrill wrote:
On 05/05/2014 12:25 PM, Paolo Carlini wrote:
Good, but is it Ok to use uses_template_parms for that? A few days ago I
struggled to find something simpler ready to use, to no avail (well,
this is probably well known to you, but there are surprisingly few
places in pt.c where we explain either in comments or in obvious code
that we are handling full (vs partial) specializations).

+/* True if the given class type is a template or a partial specialization. */
+#define CLASSTYPE_IS_TEMPLATE_OR_PARTIAL_SPECIALIZATION(NODE) \
+  (CLASSTYPE_TEMPLATE_INFO (NODE)    \
+   && uses_template_parms (NODE))

I think this would be true for a non-template member class of a template class.
On further thought (yesterday was a little tired, sorry), I think that nsdmi-template7.C is telling us that, in fact, we *do* want something true when we are handling an NSDMI inside a non-template class of a template class! Because in that case too the user code may want to use the template parameters in the initialization of the NSDMI. Well, assuming this is by and large right, we do *not* want a predicate for template or partial specialization, maybe a predicate for "dependent context", see what I mean?!? In any case, in practice, something rather close to my first try ;) (after all, the simple pattern is already used in tsubst for typedefs...)

Paolo.


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