aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99239_a.H13
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99239_b.H12
3 files changed, 25 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b1d8e44..3483b0c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2041,8 +2041,6 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
{
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
diff --git a/gcc/testsuite/g++.dg/modules/pr99239_a.H b/gcc/testsuite/g++.dg/modules/pr99239_a.H
new file mode 100644
index 0000000..35f006f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99239_a.H
@@ -0,0 +1,13 @@
+// PR 99239 ICE on catch clause
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+inline void Foo ()
+{
+ try
+ {}
+ catch(...)
+ {
+ }
+}
+
diff --git a/gcc/testsuite/g++.dg/modules/pr99239_b.H b/gcc/testsuite/g++.dg/modules/pr99239_b.H
new file mode 100644
index 0000000..92638d6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99239_b.H
@@ -0,0 +1,12 @@
+// { dg-additional-options {-fmodule-header -fno-module-lazy} }
+// { dg-module-cmi {} }
+import "pr99239_a.H";
+
+inline void
+ _M_remove_reference() throw()
+{
+ try
+ { }
+ catch(...)
+ { }
+}