2019-10-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR c++/92024
	* pt.c (instantiate_class_template_1): Avoid crash when
	CLASSTYPE_TEMPLATE_INFO is NULL.

testsuite:
2019-10-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR c++/92024
	* g++.dg/parse/crash68.C: Add -Wshadow=compatible-local to additional
	options.

Index: gcc/cp/pt.c
===================================================================
--- gcc/cp/pt.c	(revision 276634)
+++ gcc/cp/pt.c	(working copy)
@@ -10973,6 +10973,9 @@ instantiate_class_template_1 (tree type)
       || uses_template_parms (type))
     return type;
 
+  if (CLASSTYPE_TEMPLATE_INFO (type) == NULL)
+    return error_mark_node;
+
   /* Figure out which template is being instantiated.  */
   templ = most_general_template (CLASSTYPE_TI_TEMPLATE (type));
   gcc_assert (TREE_CODE (templ) == TEMPLATE_DECL);
Index: gcc/testsuite/g++.dg/parse/crash68.C
===================================================================
--- gcc/testsuite/g++.dg/parse/crash68.C	(revision 276634)
+++ gcc/testsuite/g++.dg/parse/crash68.C	(working copy)
@@ -1,4 +1,6 @@
 // PR c++/84611
+// PR c++/92024
+// { dg-additional-options "-Wshadow=compatible-local" }
 
 template<typename = int>
 struct a {
