forked from qt-creator/qt-creator
C++: fix lookups for functions with const args
Make declarations equal in case they differ only by argument const and/or volatile (13.1.3.4). Task-number: QTCREATORBUG-18475 Change-Id: Id0561fda3b9081b92716a8739ba9963e90b5d709 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
16
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
16
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
@@ -337,8 +337,22 @@ bool Function::isSignatureEqualTo(const Function *other, Matcher *matcher) const
|
||||
for (unsigned i = 0; i < argc; ++i) {
|
||||
Symbol *l = argumentAt(i);
|
||||
Symbol *r = other->argumentAt(i);
|
||||
if (! l->type().match(r->type(), matcher))
|
||||
if (! l->type().match(r->type(), matcher)) {
|
||||
if (!l->type()->isReferenceType() && !l->type()->isPointerType()
|
||||
&& !l->type()->isPointerToMemberType()
|
||||
&& !r->type()->isReferenceType() && !r->type()->isPointerType()
|
||||
&& !r->type()->isPointerToMemberType()) {
|
||||
FullySpecifiedType lType = l->type();
|
||||
FullySpecifiedType rType = r->type();
|
||||
lType.setConst(false);
|
||||
lType.setVolatile(false);
|
||||
rType.setConst(false);
|
||||
rType.setVolatile(false);
|
||||
if (lType.match(rType))
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user