Don't care which type protected operator= returns
This commit is contained in:
parent
6194a4eefd
commit
14f13afa0a
|
@ -1117,7 +1117,7 @@ void CheckClass::operatorEq()
|
||||||
std::list<Function>::const_iterator func;
|
std::list<Function>::const_iterator func;
|
||||||
|
|
||||||
for (func = scope->functionList.begin(); func != scope->functionList.end(); ++func) {
|
for (func = scope->functionList.begin(); func != scope->functionList.end(); ++func) {
|
||||||
if (func->type == Function::eOperatorEqual && func->access != Private) {
|
if (func->type == Function::eOperatorEqual && func->access == Public) {
|
||||||
// skip "deleted" functions - cannot be called anyway
|
// skip "deleted" functions - cannot be called anyway
|
||||||
if (func->isDelete)
|
if (func->isDelete)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -572,6 +572,13 @@ private:
|
||||||
"};");
|
"};");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
checkOpertorEq("class A\n"
|
||||||
|
"{\n"
|
||||||
|
"protected:\n"
|
||||||
|
" void operator=(const A&);\n"
|
||||||
|
"};");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
checkOpertorEq("class A\n"
|
checkOpertorEq("class A\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"private:\n"
|
"private:\n"
|
||||||
|
|
Loading…
Reference in New Issue