aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Sutton <asutton@lock3software.com>2019-11-19 15:26:16 +0000
committerAndrew Sutton <asutton@gcc.gnu.org>2019-11-19 15:26:16 +0000
commitc286fb4ed5706cb4de40da0eb798e31bb16eb05b (patch)
tree368e324d523f233f75edaa2df20555cc5db5596e /gcc
parentcce3c9db9e6ffad764504134336c714a90416e8d (diff)
downloadgcc-c286fb4ed5706cb4de40da0eb798e31bb16eb05b.zip
gcc-c286fb4ed5706cb4de40da0eb798e31bb16eb05b.tar.gz
gcc-c286fb4ed5706cb4de40da0eb798e31bb16eb05b.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/pr89913.C6
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 08b44c5..cc7a58e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,15 @@
+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>
PR c++/92078
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 59f9d03..064fe5b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6395,6 +6395,9 @@ get_underlying_template (tree tmpl)
{
/* Determine if the alias is equivalent to an underlying template. */
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);
if (!tinfo)
break;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index edbf126..13ce849 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+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>
PR c++/92078
diff --git a/gcc/testsuite/g++.dg/cpp2a/pr89913.C b/gcc/testsuite/g++.dg/cpp2a/pr89913.C
new file mode 100644
index 0000000..c06847e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/pr89913.C
@@ -0,0 +1,6 @@
+// { 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...>;