diff mbox

[C++] c++/78776 fix alias template ICE

Message ID 502054c6-869f-f4e5-b7e6-9a3bf1e19da1@acm.org
State New
Headers show

Commit Message

Nathan Sidwell Dec. 14, 2016, 12:51 p.m. UTC
On 12/13/2016 03:58 PM, Jason Merrill wrote:

> I'm still seeing the redundant DECL_LANG_SPECIFIC check.

Sorry, I misunderstood which check you meant was redundant.  In the 
original patch, the first check wasn't redundant (but the second check 
was entirely within the codepath of the first).  But with the newer 
patch it turns out the first one is not needed.

Is this what you meant? (usual build & test passes)

nathan

Comments

Jason Merrill Dec. 14, 2016, 4:31 p.m. UTC | #1
Yes, thanks.

On Wed, Dec 14, 2016 at 7:51 AM, Nathan Sidwell <nathan@acm.org> wrote:
> On 12/13/2016 03:58 PM, Jason Merrill wrote:
>
>> I'm still seeing the redundant DECL_LANG_SPECIFIC check.
>
>
> Sorry, I misunderstood which check you meant was redundant.  In the original
> patch, the first check wasn't redundant (but the second check was entirely
> within the codepath of the first).  But with the newer patch it turns out
> the first one is not needed.
>
> Is this what you meant? (usual build & test passes)
>
> nathan
>
> --
> Nathan Sidwell
diff mbox

Patch

2016-12-14  Nathan Sidwell  <nathan@acm.org>

	PR c++/69481
	* cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Always use
	TYPE_ALIAS_TEMPLATE_INFO for aliases.

Index: cp/cp-tree.h
===================================================================
--- cp/cp-tree.h	(revision 243647)
+++ cp/cp-tree.h	(working copy)
@@ -3049,18 +3049,18 @@  extern void decl_shadowed_for_var_insert
 	 ? CLASSTYPE_TEMPLATE_INFO (NODE)				\
 	 : NULL_TREE)))
 
-/* Template information for an alias template type.  */
+/* Template information (if any) for an alias type.  */
 #define TYPE_ALIAS_TEMPLATE_INFO(NODE)					\
   (DECL_LANG_SPECIFIC (TYPE_NAME (NODE))				\
    ? DECL_TEMPLATE_INFO (TYPE_NAME (NODE))				\
    : NULL_TREE)
 
-/* If NODE is a specialization of an alias template, this accessor
-   returns the template info for the alias template.  Otherwise behave
-   as TYPE_TEMPLATE_INFO.  */
+/* If NODE is a type alias, this accessor returns the template info
+   for the alias template (if any).  Otherwise behave as
+   TYPE_TEMPLATE_INFO.  */
 #define TYPE_TEMPLATE_INFO_MAYBE_ALIAS(NODE)				\
-  (TYPE_ALIAS_P (NODE) && DECL_LANG_SPECIFIC (TYPE_NAME (NODE))		\
-   ? DECL_TEMPLATE_INFO (TYPE_NAME (NODE))				\
+  (TYPE_ALIAS_P (NODE)							\
+   ? TYPE_ALIAS_TEMPLATE_INFO (NODE)					\
    : TYPE_TEMPLATE_INFO (NODE))
 
 /* Set the template information for an ENUMERAL_, RECORD_, or