File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1515
1616import cpp
1717import codingstandards.cpp.autosar
18+ import codingstandards.cpp.Class
1819
1920/**
2021 * Holds if the class has a non-virtual member function with the given name.
4849 ) and
4950 // Exclude compiler generated member functions which include things like copy constructor that hide base class
5051 // copy constructors.
51- not overridingDecl .isCompilerGenerated ( )
52+ not overridingDecl .isCompilerGenerated ( ) and
53+ // Exclude special member functions, which cannot be inherited.
54+ not overridingDecl instanceof SpecialMemberFunction
5255select overridingDecl ,
5356 "Declaration for member '" + name + "' hides non-overridable inherited member function $@" ,
5457 hiddenDecl , hiddenDecl .getName ( )
Original file line number Diff line number Diff line change @@ -76,4 +76,9 @@ void f2() {
7676 c5.f1 (0.0 ); // calls C5::f1(double)
7777 c5.f2 (0 ); // calls C1::f2(int)
7878 c5.f2 (0.0 ); // calls C5::f2(double)
79- }
79+ }
80+
81+ class C6 : public C1 {
82+ public:
83+ C6 &operator =(const C6 &); // COMPLIANT
84+ };
You can’t perform that action at this time.
0 commit comments