@@ -7723,17 +7723,14 @@ finish_struct (tree t, tree attributes)
lookup not to fail or recurse into bases. This isn't added
to the template decl list so we drop this at instantiation
time. */
- if (!get_class_binding_direct (t, assign_op_identifier, false))
- {
- tree ass_op = build_lang_decl (USING_DECL, assign_op_identifier,
- NULL_TREE);
- DECL_CONTEXT (ass_op) = t;
- USING_DECL_SCOPE (ass_op) = t;
- DECL_DEPENDENT_P (ass_op) = true;
- DECL_ARTIFICIAL (ass_op) = true;
- DECL_CHAIN (ass_op) = TYPE_FIELDS (t);
- TYPE_FIELDS (t) = ass_op;
- }
+ tree ass_op = build_lang_decl (USING_DECL, assign_op_identifier,
+ NULL_TREE);
+ DECL_CONTEXT (ass_op) = t;
+ USING_DECL_SCOPE (ass_op) = t;
+ DECL_DEPENDENT_P (ass_op) = true;
+ DECL_ARTIFICIAL (ass_op) = true;
+ DECL_CHAIN (ass_op) = TYPE_FIELDS (t);
+ TYPE_FIELDS (t) = ass_op;
TYPE_SIZE (t) = bitsize_zero_node;
TYPE_SIZE_UNIT (t) = size_zero_node;
new file mode 100644
@@ -0,0 +1,16 @@
+// PR c++/105223
+
+struct ServiceReferenceBase {
+ void operator=(int);
+};
+
+template<class>
+struct ServiceReference : ServiceReferenceBase {
+ void foo() { operator=(0); }
+ using ServiceReferenceBase::operator=;
+};
+
+int main() {
+ ServiceReference<int> sr;
+ sr.foo();
+}