No bug here, but a feature request. it would be nice if for such code class Base { public: int base; }; typedef const Base ConstBase; class CDerived: public ConstBase { public: int derived; }; gcc reports a warning. http://eel.is/c++draft/class.derived.general#2.sentence-2
I don't see any benefit to this warning. What harm does the example code do? Has anybody ever been confused about the semantics, and expected the cv-qualifiers to have an effect? If this language feature doesn't lead to confusion or mistaken code, why should there be a warning?
>Has anybody ever been confused about the semantics, and expected the cv-qualifiers to have an effect? Yes. I saw a question on one forum why constness is not taken into account when inheriting and whether there is a compiler bug.