Commit 99422caa by Paolo Carlini Committed by Paolo Carlini

class.c (resolve_address_of_overloaded_function): Don't emit an inform if the…

class.c (resolve_address_of_overloaded_function): Don't emit an inform if the matching permerror returns false.

/cp
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.

/testsuite
2018-07-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/template/spec40.C: New.
	* g++.dg/parse/ptrmem8.C: Likewise.

From-SVN: r262740
parent 20b47be0
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> 2018-07-16 Jakub Jelinek <jakub@redhat.com>
PR c++/3698 PR c++/3698
......
...@@ -7919,10 +7919,11 @@ resolve_address_of_overloaded_function (tree target_type, ...@@ -7919,10 +7919,11 @@ resolve_address_of_overloaded_function (tree target_type,
if (!(complain & tf_error)) if (!(complain & tf_error))
return error_mark_node; return error_mark_node;
permerror (input_location, "assuming pointer to member %qD", fn); if (permerror (input_location, "assuming pointer to member %qD", fn)
if (!explained) && !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; explained = 1;
} }
} }
......
...@@ -800,10 +800,10 @@ check_specialization_namespace (tree tmpl) ...@@ -800,10 +800,10 @@ check_specialization_namespace (tree tmpl)
return true; return true;
else else
{ {
permerror (input_location, if (permerror (input_location,
"specialization of %qD in different namespace", tmpl); "specialization of %qD in different namespace", tmpl))
inform (DECL_SOURCE_LOCATION (tmpl), inform (DECL_SOURCE_LOCATION (tmpl),
" from definition of %q#D", tmpl); " from definition of %q#D", tmpl);
return false; 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> 2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com>
* gcc.target/s390/mnop-mcount-m31-fpic.c: New testcase. * gcc.target/s390/mnop-mcount-m31-fpic.c: New testcase.
......
// { 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>();
}
// { 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() {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment