Lots of std::vector operator [] false negatives in VS2015

I'm getting lots of "No 'operator []' matches arguments of type 'std::vector<XY>' and 'int'" errors, and by lots I mean this many in just one source file:

This happens with all std::vectors (regardless of data type) and any arguments to the [] operator, including literals. Needless to say, the code compiles fine.

ReSharper Ultimate 2020.1.3 built on 2020-05-15 running in VS 2015 (14.0.25431.1)

Could it be because of the old VS version?

I've seen a similar issue in the issue tracker, but that was Linux and with some other container type (unordered_map I think).

0
9 comments
Avatar
Permanently deleted user

Hello,

Sorry, I can't reproduce this problem. Could you please try to create a self-contained repro solution which demonstrates this issue and attach it to https://youtrack.jetbrains.com/issue/RSCPP-30647?

Thanks!

0

It's not happening with a trivial project, which means it's caused by something we use. I will investigate further.

0

I did some further experiments, but so far I haven't pinpointed the issue. It happens with trivial files within our project:

But it works with the same source file outside of our project, and even with some of the stuff we use added.

Next I'll have to start removing stuff from our project gradually until the error goes away.

0
Avatar
Permanently deleted user

Thanks! You can probably just take your .vcxproj and leave a single .cpp file in it.

0

Thanks for the tip. I removed everything from the project except a single .cpp and it's still happening.

Here's the resulting project:

https://www.dropbox.com/s/4oazirphlhng8wo/TestApp.zip?dl=0 

0
Avatar
Permanently deleted user

Thanks a lot, I can reproduce this on your solution. There seems to be an issue with reading project properties from this particular solution, I don't think there's a simple workaround at the moment. I believe you can try opening your solution in a later version of VS (e.g. VS2017) and everything should work fine. We'll investigate further - https://youtrack.jetbrains.com/issue/RSCPP-31102

0

That's very helpful Igor, thank you very much.

We wanted to upgrade to the latest VS version for some time, so we'll fast track that now.

0

I can confirm that the upgrade to VS2019 solved it.

0
Avatar
Permanently deleted user

Great, thanks for the confirmation and sorry about the issue.

0

Please sign in to leave a comment.