[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 299310] New: Element type is incorrectly deduced in range-based for loop with QVector
From:       Alexander Shaduri <ashaduri () yandex ! ru>
Date:       2012-05-03 17:02:54
Message-ID: bug-299310-40295 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=299310

            Bug ID: 299310
          Severity: normal
           Version: git master
          Priority: NOR
          Assignee: kdevelop-bugs@kdevelop.org
           Summary: Element type is incorrectly deduced in range-based for
                    loop with QVector
    Classification: Unclassified
                OS: Linux
          Reporter: ashaduri@yandex.ru
          Hardware: openSUSE RPMs
            Status: UNCONFIRMED
         Component: Language Support: CPP
           Product: kdevelop

I'm using KDevelop git master (2012-05-03).

Consider the following example:

#include <QVector>
void func()
{
    QVector<double> vec;
    for (auto elem : vec) {  // popup says elem is int
    }
}

The popup says "elem" variable is of type "int", when in fact it should be
double&. Note that this problem occurs with QVector, QSet, etc..., but not with
std::vector, std::list, etc...

Thanks

Reproducible: Always

Steps to Reproduce:
1. Try the code above.

Actual Results:  
Invalid type is deduced.

Expected Results:  
Correct type should be deduced.

openSUSE 12.1 x86-64, KDE 4.7.2.

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic