This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71365] New: [7 Regression] g++ reject access to parent's parent virtual method
- From: "zsojka at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 31 May 2016 20:35:37 +0000
- Subject: [Bug c++/71365] New: [7 Regression] g++ reject access to parent's parent virtual method
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71365
Bug ID: 71365
Summary: [7 Regression] g++ reject access to parent's parent
virtual method
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Created attachment 38615
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38615&action=edit
testcase (from openttd)
Compiler output:
$ g++ accept.C
accept.C: In member function 'virtual void C<T>::foo()':
accept.C:7:55: error: 'A' is not a base of 'C<T>'
class C : public B<T> { virtual void foo() { this->A::foo(); } };
^~~
I think this code is valid, and it is accepted by all GCC versions up to 6.1.1.
If it is invalid, the error message should be improved to mention, for example,
"direct base". Note the code is accepted if B is not a template.