[Bug c++/98538] [11 Regression] ICE in cp_build_qualified_type_real, at cp/tree.c:1335

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 15 21:04:17 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98538

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Nathan Sidwell from comment #5)
> I don;t think your patch is quite right.  the call afterwards is making the
> assumption that DEPENDENT_TYPE_P is only ever set when
> DEPENDENT_TYPE_P_VALID is true, and as I discovered, that is not correct.
> see this code near pt.c:14899
> 
>      set_underlying_type (r);
> 	    if (TYPE_DECL_ALIAS_P (r))
> 	      /* An alias template specialization can be dependent
> 		 even if its underlying type is not.  */
> 	      TYPE_DEPENDENT_P_VALID (TREE_TYPE (r)) = false;
> 	  }

Right, that's what lead me to tweaking the assert to not crash for alias
template specializations.

But I like your patch better.

> I did wonder if we should just recalculate properly there though ...
> 
> 'tis annoying that 'taking' a bug does not put it in the assigned state :(

Indeed :/.

Thanks for fixing this.


More information about the Gcc-bugs mailing list