C++: fix follow symbol for const arguments

Fixed case:

class Foo {};
void foo(int v) {}
void foo(const char *v) {}
void foo(const Foo &v) {}
void foo(char v) {}

void test()
{
    foo(5);
    foo("hoo");
    foo('a');
    char *var = "var";
    foo(var); // Jumps to last override, regardless of its type
    Foo f;
    foo(f); // Jumps to last override
}

Task-number: QTCREATORBUG-13128
Change-Id: I038553bb3bdbe1c300fc01573c14b6fedf0320cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Przemyslaw Gorszkowski
2014-10-07 10:01:14 +02:00
committed by Nikolai Kosjar
parent 2de666da61
commit 0ff1cba77b
4 changed files with 105 additions and 52 deletions

View File

@@ -77,7 +77,6 @@ protected:
void addResults(const QList<LookupItem> &items);
static bool maybeValidPrototype(Function *funTy, unsigned actualArgumentCount);
bool implicitConversion(const FullySpecifiedType &sourceTy, const FullySpecifiedType &targetTy) const;
using ASTVisitor::visit;