diff mbox series

c++: Module ICE fix

Message ID 7b255c08-9b25-46b3-a143-bc961404436b@acm.org
State New
Headers show
Series c++: Module ICE fix | expand

Commit Message

Nathan Sidwell Dec. 22, 2020, 8:44 p.m. UTC
A missing check for decl lang specific has made    itself apparent.

     gcc/cp/
         * module.cc (has_definition): Check DECL_LANG_SPECIFIC.


(test in the next uber-patch)
diff mbox series

Patch

diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc
index ed3dbe244a3..19fe66346bd 100644
--- i/gcc/cp/module.cc
+++ w/gcc/cp/module.cc
@@ -11374,7 +11374,8 @@  has_definition (tree decl)
       break;
 
     case VAR_DECL:
-      if (DECL_TEMPLATE_INFO (decl)
+      if (DECL_LANG_SPECIFIC (decl)
+	  && DECL_TEMPLATE_INFO (decl)
 	  && DECL_USE_TEMPLATE (decl) < 2)
 	return DECL_INITIAL (decl);
       else