Commit f70d81ba by Paolo Carlini Committed by Paolo Carlini

re PR c++/90909 (call devirtualized to pure virtual)

/cp
2019-06-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/90909
	Revert:
	2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67184
	PR c++/69445
	* call.c (build_over_call): Devirtualize when the final overrider
	comes from the base.

/testsuite
2019-06-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/90909
	Revert:
	2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/67184
	PR c++/69445
	* g++.dg/other/final3.C: New.
	* g++.dg/other/final4.C: Likewise.
	* g++.dg/other/final5.C: Likewise.

	* g++.dg/other/final6.C: New.

From-SVN: r272573
parent 32833537
2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90909
Revert:
2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.
2019-06-21 Marek Polacek <polacek@redhat.com> 2019-06-21 Marek Polacek <polacek@redhat.com>
PR c++/61490 - qualified-id in friend function definition. PR c++/61490 - qualified-id in friend function definition.
......
...@@ -8244,7 +8244,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) ...@@ -8244,7 +8244,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
/* See if the function member or the whole class type is declared /* See if the function member or the whole class type is declared
final and the call can be devirtualized. */ final and the call can be devirtualized. */
if (DECL_FINAL_P (fn) if (DECL_FINAL_P (fn)
|| CLASSTYPE_FINAL (TREE_TYPE (argtype))) || CLASSTYPE_FINAL (TYPE_METHOD_BASETYPE (TREE_TYPE (fn))))
flags |= LOOKUP_NONVIRTUAL; flags |= LOOKUP_NONVIRTUAL;
/* [class.mfct.nonstatic]: If a nonstatic member function of a class /* [class.mfct.nonstatic]: If a nonstatic member function of a class
......
2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90909
Revert:
2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.
* g++.dg/other/final6.C: New.
2019-06-21 Marek Polacek <polacek@redhat.com> 2019-06-21 Marek Polacek <polacek@redhat.com>
PR c++/61490 - qualified-id in friend function definition. PR c++/61490 - qualified-id in friend function definition.
......
// PR c++/90909
// { dg-do link { target c++11 } }
struct S1 { virtual void f() = 0; };
struct S2: S1 { virtual void f() {} };
struct S3: S2 { using S1::f; };
struct S4 final: S3 { void g(); };
void S4::g() { f(); }
int main() { S4().g(); }
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