+2018-07-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * class.c (resolve_address_of_overloaded_function): Don't emit an
+ inform if the matching permerror returns false.
+ * pt.c (check_specialization_namespace): Likewise.
+
2018-07-16 Jakub Jelinek <jakub@redhat.com>
PR c++/3698
if (!(complain & tf_error))
return error_mark_node;
- permerror (input_location, "assuming pointer to member %qD", fn);
- if (!explained)
+ if (permerror (input_location, "assuming pointer to member %qD", fn)
+ && !explained)
{
- inform (input_location, "(a pointer to member can only be formed with %<&%E%>)", fn);
+ inform (input_location, "(a pointer to member can only be "
+ "formed with %<&%E%>)", fn);
explained = 1;
}
}
return true;
else
{
- permerror (input_location,
- "specialization of %qD in different namespace", tmpl);
- inform (DECL_SOURCE_LOCATION (tmpl),
- " from definition of %q#D", tmpl);
+ if (permerror (input_location,
+ "specialization of %qD in different namespace", tmpl))
+ inform (DECL_SOURCE_LOCATION (tmpl),
+ " from definition of %q#D", tmpl);
return false;
}
}
+2018-07-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/template/spec40.C: New.
+ * g++.dg/parse/ptrmem8.C: Likewise.
+
2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com>
* gcc.target/s390/mnop-mcount-m31-fpic.c: New testcase.
--- /dev/null
+// { dg-options "-fpermissive -w" }
+
+struct A
+{
+ template<int> void foo()
+ {
+ void (A::* fp)();
+ fp = A::foo<0>; // { dg-bogus "pointer to member" }
+ }
+};
+
+void bar()
+{
+ A().foo<0>();
+}
--- /dev/null
+// { dg-options "-fpermissive -w" }
+
+namespace N {
+ template <typename T>
+ struct S {
+ void f() {} // { dg-bogus "from definition" }
+ };
+}
+
+namespace K {
+ template <> void N::S<char>::f() {}
+}