Summary: | Element type is incorrectly deduced in range-based for loop with QVector | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Alexander Shaduri <ashaduri> |
Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | 4.3.0 | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdevelop/25c9de709d85f6288ea2dcc68ee2ef15125015be | Version Fixed In: | |
Sentry Crash Report: |
Description
Alexander Shaduri
2012-05-03 17:02:54 UTC
Git commit 25c9de709d85f6288ea2dcc68ee2ef15125015be by Milian Wolff. Committed on 14/05/2012 at 21:16. Pushed by mwolff into branch '4.3'. Fix begin-lookup for auto-type deduction in range-based for loops. First up, ensure we pick the proper list type by introducing a virtual ContextBuilder::handleRangeBasedFor that is then overwritten in the DeclarationBuilder. This way we can ensure that lastType() actually returns the type we want. Then, when we don't find a viable begin function in the current namespace via ADL, fallback to ::std::begin (in accordance to the spec) and repeat. M +7 -2 languages/cpp/cppduchain/contextbuilder.cpp M +1 -0 languages/cpp/cppduchain/contextbuilder.h M +39 -8 languages/cpp/cppduchain/declarationbuilder.cpp M +1 -1 languages/cpp/cppduchain/declarationbuilder.h M +0 -1 languages/cpp/cppduchain/overloadresolutionhelper.cpp M +1 -0 languages/cpp/cppduchain/tests/test_duchain.h M +62 -0 languages/cpp/cppduchain/tests/test_duchain_cpp2011.cpp http://commits.kde.org/kdevelop/25c9de709d85f6288ea2dcc68ee2ef15125015be |