Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.08 KB

compiler-error-c2584.md

File metadata and controls

47 lines (37 loc) · 1.08 KB
descriptiontitlems.datef1_keywordshelpviewer_keywordsms.assetid
Learn more about: Compiler Error C2584
Compiler Error C2584
11/04/2016
C2584
C2584
836e2c0a-86c0-4742-b432-beb0191ad20e

Compiler Error C2584

'Class' : direct base 'Base2' is inaccessible; already a base of 'Base1'

Class already derives directly from Base1. Base2 also derives from Base1. Class cannot derive from Base2 because that would mean inheriting (indirectly) from Base1 again, which is not legal because Base1 is already a direct base class.

Example

The following sample generates C2584.

// C2584.cpp// compile with: /cstructA1 { virtualintMyFunction(); }; structA2 { virtualintMyFunction(); }; structB1: publicvirtual A1, virtual A2 { virtualintMyFunction(); }; structB2: publicvirtual A2, virtual A1 { virtualintMyFunction(); }; structC: virtual B1, B2 { virtualintMyFunction(); }; structZ : virtual B2, virtual C { // C2584// try the following line insted// struct Z : virtual C {virtualintMyFunction(); };
close