This was simply an overzealous assert. Possibly correct thinking at
the time that code was written, but not true now. Of course we can
have imported artificial decls.
PR c++/99239
gcc/cp/
* decl.c (duplicate_decls): Remove assert about maybe-imported
artificial decls.
gcc/testsuite/
* g++.dg/modules/pr99239_a.H: New.
* g++.dg/modules/pr99239_b.H: New.
{
if (DECL_ARTIFICIAL (olddecl))
{
- gcc_checking_assert (!(DECL_LANG_SPECIFIC (olddecl)
- && DECL_MODULE_IMPORT_P (olddecl)));
if (!(global_purview_p () || not_module_p ()))
error ("declaration %qD conflicts with builtin", newdecl);
else
--- /dev/null
+// PR 99239 ICE on catch clause
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+inline void Foo ()
+{
+ try
+ {}
+ catch(...)
+ {
+ }
+}
+
--- /dev/null
+// { dg-additional-options {-fmodule-header -fno-module-lazy} }
+// { dg-module-cmi {} }
+import "pr99239_a.H";
+
+inline void
+ _M_remove_reference() throw()
+{
+ try
+ { }
+ catch(...)
+ { }
+}