Fixed #9359 (SymbolDatabase: function lookup fails when -funsigned-char is used)

This commit is contained in:
Daniel Marjamäki 2019-10-06 12:05:58 +02:00
parent 0950a97df2
commit 3c085fd88a
3 changed files with 12 additions and 8 deletions

View File

@ -140,6 +140,10 @@ matrix:
- cmake -G "Unix Makefiles" -DBUILD_TESTS=On ..
- make -j2 check
- cd ..
# -funsigned-char
- make clean
- make -j2 CXXFLAGS=-funsigned-char testrunner
- ./testrunner TestSymbolDatabase
# check if dmake needs to be rerun (this job may fail)
- name: "rerun dmake?"

View File

@ -5992,7 +5992,7 @@ ValueType::MatchResult ValueType::matchParameter(const ValueType *call, const Va
return ValueType::MatchResult::UNKNOWN;
if (call->isIntegral() && func->isIntegral() && call->sign != ValueType::Sign::UNKNOWN_SIGN && func->sign != ValueType::Sign::UNKNOWN_SIGN && call->sign != func->sign)
return ValueType::MatchResult::UNKNOWN; // TODO
return ValueType::MatchResult::FALLBACK1;
return ValueType::MatchResult::SAME;
}

View File

@ -5380,11 +5380,7 @@ private:
f = Token::findsimplematch(tokenizer.tokens(), "get ( get ( v2 ) ) ;");
ASSERT(f);
ASSERT(f->function());
if (std::numeric_limits<char>::is_signed) {
ASSERT_EQUALS(5, f->function()->tokenDef->linenr());
} else {
ASSERT_EQUALS(10, f->function()->tokenDef->linenr());
}
ASSERT_EQUALS(5, f->function()->tokenDef->linenr());
f = Token::findsimplematch(tokenizer.tokens(), "get ( get ( v3 ) ) ;");
ASSERT(f);
@ -5409,7 +5405,11 @@ private:
f = Token::findsimplematch(tokenizer.tokens(), "get ( get ( v7 ) ) ;");
ASSERT(f);
ASSERT(f->function());
ASSERT_EQUALS(10, f->function()->tokenDef->linenr());
if (std::numeric_limits<char>::is_signed) {
ASSERT_EQUALS(10, f->function()->tokenDef->linenr());
} else {
ASSERT_EQUALS(5, f->function()->tokenDef->linenr());
}
f = Token::findsimplematch(tokenizer.tokens(), "get ( get ( v8 ) ) ;");
ASSERT(f);
@ -5417,7 +5417,7 @@ private:
if (std::numeric_limits<char>::is_signed) {
ASSERT_EQUALS(5, f->function()->tokenDef->linenr());
} else {
ASSERT_EQUALS(10, f->function()->tokenDef->linenr());
ASSERT_EQUALS(11, f->function()->tokenDef->linenr());
}
f = Token::findsimplematch(tokenizer.tokens(), "get ( get ( v9 ) ) ;");