Commit c286fb4e by Andrew Sutton Committed by Andrew Sutton

re PR c++/89913 (ICE with invalid using declaration)

PR c++/89913

gcc/cp/
	* pt.c (get_underlying_template): Exit loop if the original type
	of the alias is null.

gcc/testsuite/
	* g++.dg/cpp2a/pr89913.C: New test.

From-SVN: r278451
parent cce3c9db
2019-11-15 Andrew Sutton <asutton@lock3software.com>
PR c++/89913
* pt.c (get_underlying_template): Exit loop if the original type
of the alias is null.
2019-11-19 Andrew Sutton <asutton@lock3software.com>
PR c++/92078
* pt.c (maybe_new_partial_specialization): Apply access to newly
created partial specializations. Update comment style.
2019-11-19 Andrew Sutton <asutton@lock3software.com> 2019-11-19 Andrew Sutton <asutton@lock3software.com>
PR c++/92078 PR c++/92078
......
...@@ -6395,6 +6395,9 @@ get_underlying_template (tree tmpl) ...@@ -6395,6 +6395,9 @@ get_underlying_template (tree tmpl)
{ {
/* Determine if the alias is equivalent to an underlying template. */ /* Determine if the alias is equivalent to an underlying template. */
tree orig_type = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl)); tree orig_type = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl));
/* The underlying type may have been ill-formed. Don't proceed. */
if (!orig_type)
break;
tree tinfo = TYPE_TEMPLATE_INFO_MAYBE_ALIAS (orig_type); tree tinfo = TYPE_TEMPLATE_INFO_MAYBE_ALIAS (orig_type);
if (!tinfo) if (!tinfo)
break; break;
......
2019-11-15 Andrew Sutton <asutton@lock3software.com>
PR c++/89913
* g++.dg/cpp2a/pr89913.C: New test.
2019-11-19 Andrew Sutton <asutton@lock3software.com> 2019-11-19 Andrew Sutton <asutton@lock3software.com>
PR c++/92078 PR c++/92078
......
// { dg-do compile { target c++2a } }
template<typename...> using A = auto; // { dg-error "not allowed" }
// In pre-20, the error is "invalid use of auto"
template<typename... T> using B = A<T...>;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment