aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/module.cc4
-rw-r--r--gcc/testsuite/g++.dg/modules/concept-11_a.H9
-rw-r--r--gcc/testsuite/g++.dg/modules/concept-11_b.C9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c6
4 files changed, 22 insertions, 6 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 5ff5c46..a2e0d6d 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -7386,7 +7386,7 @@ trees_out::lang_decl_vals (tree t)
WU (lang->u.fn.ovl_op_code);
}
- if (DECL_CLASS_SCOPE_P (t))
+ if (DECL_CLASS_SCOPE_P (t) || DECL_UNIQUE_FRIEND_P (t))
WT (lang->u.fn.context);
if (lang->u.fn.thunk_p)
@@ -7470,7 +7470,7 @@ trees_in::lang_decl_vals (tree t)
lang->u.fn.ovl_op_code = code;
}
- if (DECL_CLASS_SCOPE_P (t))
+ if (DECL_CLASS_SCOPE_P (t) || DECL_UNIQUE_FRIEND_P (t))
RT (lang->u.fn.context);
if (lang->u.fn.thunk_p)
diff --git a/gcc/testsuite/g++.dg/modules/concept-11_a.H b/gcc/testsuite/g++.dg/modules/concept-11_a.H
new file mode 100644
index 0000000..4512768
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/concept-11_a.H
@@ -0,0 +1,9 @@
+// PR c++/119939
+// { dg-additional-options "-fmodule-header -std=c++20" }
+// { dg-module-cmi {} }
+
+template <typename T> concept A = true;
+template <typename T> concept B = requires { T{}; };
+template <typename T> struct S {
+ friend bool operator==(const S&, const S&) requires B<T> = default;
+};
diff --git a/gcc/testsuite/g++.dg/modules/concept-11_b.C b/gcc/testsuite/g++.dg/modules/concept-11_b.C
new file mode 100644
index 0000000..3f6676f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/concept-11_b.C
@@ -0,0 +1,9 @@
+// PR c++/119939
+// { dg-additional-options "-fmodules -std=c++20" }
+
+import "concept-11_a.H";
+
+int main() {
+ S<int> s;
+ s == s;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c
index 5a7588f..246fea3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c
@@ -1,6 +1,4 @@
-/* If the target returns false for TARGET_PROMOTE_PROTOTYPES, then there
- will be no casts for FRE to eliminate and the test will fail. */
-/* { dg-do compile { target i?86-*-* x86_64-*-* hppa*-*-* m68k*-*-* } } */
+/* { dg-do compile } */
/* { dg-options "-O -fno-tree-ccp -fno-tree-forwprop -fdump-tree-fre1-details" } */
/* From PR21608. */
@@ -11,4 +9,4 @@ char bar(char f)
return wrap(f);
}
-/* { dg-final { scan-tree-dump "Replaced \\\(char\\\) .*with " "fre1" } } */
+/* { dg-final { scan-tree-dump-not " = \\\(\[^)\]*\\\)" "fre1" } } */