0

I've been working with VS for a long time now and it's a nice IDE in my opinion, but sometimes the intellisense breaks and reports non-existent errors. Usually these go away after a little while, or after rebuilding the intellisense cache, but this time it actually seems to be stuck. An image of how this looks in my IDE: (this is VS2017)

Intellisense errors

When hovering over names as 'position', I get messages like: class "Saturn::Components::Transform" has no member named "position", while it obviously has one, as becomes clear when compiling the code, which works just fine.

I've been changing settings everywhere for a little while now and I have no idea how to fix this. Any help is greatly appreciated!

MivVG
  • 679
  • 4
  • 16
  • Have you tried restarting VS? Yesterday I had nonsense like this stuck in the error box until I did a restart. They seem to have rebroken it on the last update, as it's worse than usual. – Carcigenicate May 11 '19 at 15:28
  • I tried it twice, sadly without success. – MivVG May 11 '19 at 15:30
  • Hi friend, any update for this issue? If Michael's answer help resolve it? If so, please consider checking is as the "accepted answer" to your question. ;) – LoLance May 15 '19 at 06:26
  • It seems to have fixed itself for no apparent reason. His answer is valid though so I’ll accept it anyway for future reference. – MivVG May 16 '19 at 16:33

1 Answers1

2

As far as I know, IntelliSense is fed from a different compiler frontend (based on the EDG frontent) than the one the Visual C++ compiler uses. Thus, it happens from time to time that there are discrepancies between what IntelliSense thinks is valid code and what the Visual C++ compiler will accept when your code is actually compiled. For example, when Visual C++ adds new, experimental features, IntelliSense will often not yet be updated to know about them and mark the corresponding code as erroneous. This also goes the other way, as the EDG frontend, at least historically, has had much better standard's conformance than Visual C++, so it can happen that IntelliSense will consider certain code valid while Visual C++, when you actually compile the code, complains (this has significantly improved over the last couple versions of Visual C++, though, one sees this happening less and less). On top of that, each of these frontends has their own separate set of bugs…

Most likely, what's happening with your structured bindings is that IntelliSense in the version of VS 2017 you're using simply doesn't support structured bindings yet. As far as I remember, that used to be an issue back when they introduced that feature in VS 2017 Update 3 (or around that time). You may want to consider updating your VS 2017 to a more recent version as I seem unable to reproduce this issue with current VS 2017 (version 15.9.11) here…

Michael Kenzel
  • 15,508
  • 2
  • 30
  • 39