(char *) newdecl + sizeof (struct tree_common),
sizeof (struct tree_decl_common) - sizeof (struct tree_common));
- if (DECL_LANG_SPECIFIC (olddecl) && DECL_TEMPLATE_INFO (olddecl))
- {
- /* Repropagate the module information to the template. */
- tree tmpl = DECL_TI_TEMPLATE (olddecl);
-
- if (DECL_TEMPLATE_RESULT (tmpl) == olddecl)
- {
- DECL_MODULE_PURVIEW_P (tmpl) = DECL_MODULE_PURVIEW_P (olddecl);
- gcc_checking_assert (!DECL_MODULE_IMPORT_P (olddecl));
- DECL_MODULE_IMPORT_P (tmpl) = false;
- }
- }
-
switch (TREE_CODE (newdecl))
{
case LABEL_DECL:
}
}
+ if (DECL_LANG_SPECIFIC (olddecl) && DECL_TEMPLATE_INFO (olddecl))
+ {
+ /* Repropagate the module information to the template. */
+ tree tmpl = DECL_TI_TEMPLATE (olddecl);
+
+ if (DECL_TEMPLATE_RESULT (tmpl) == olddecl)
+ {
+ DECL_MODULE_PURVIEW_P (tmpl) = DECL_MODULE_PURVIEW_P (olddecl);
+ gcc_checking_assert (!DECL_MODULE_IMPORT_P (olddecl));
+ DECL_MODULE_IMPORT_P (tmpl) = false;
+ }
+ }
+
if (VAR_OR_FUNCTION_DECL_P (newdecl))
{
if (DECL_EXTERNAL (olddecl)
gcc_checking_assert (!use_tpl);
/* Get to the TEMPLATE_DECL. */
decl = TI_TEMPLATE (ti);
+ gcc_checking_assert (!DECL_MODULE_IMPORT_P (decl));
}
/* Record it on the class_members list. */
--- /dev/null
+// PR 99153 Mismatched flags on template and result
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+import "pr99153_a.H";
+
+template<class _T1>
+inline void pair<_T1>::Frob()
+{ }
+
+
+template<typename _T2>
+inline void Widget ()
+{
+}