Author Topic: Issues with preview/push_tag and structured bindings C++17  (Read 197 times)

rowbearto

  • Senior Community Member
  • Posts: 1353
  • Hero Points: 101
Issues with preview/push_tag and structured bindings C++17
« on: April 07, 2019, 04:53:21 pm »
See this source file:

https://github.com/MaskRay/ccls/blob/master/src/message_handler.cc#L304

On Line 304 we have:

Code: [Select]
for (auto [sym, refcnt] : file.symbol2refcnt) {
If I put the cursor in "sym" and go into the preview window, it doesn't show the right thing and it does not properly show the evaluated type as "ExtentRef".

Inside this 'for' loop, if I place the cursor on a "sym" and do "push_tag", it does not take me to the for loop where sym is defined in the structured binding. For example, on line 340, put the cursor on "sym" and do "push_tag".

FYI: I created an "Other C/C++" SE project with all the source files in this repository and was in this file when reproducing this. But maybe only this source file required to repro? I did not try with just this source file but I think it should repro with just this file.

I'm using SE 23.0.1.2 x64 on Linux, CentOS 7.2, hotfix 2.
« Last Edit: April 07, 2019, 05:02:35 pm by rowbearto »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2661
  • Hero Points: 410
Re: Issues with preview/push_tag and structured bindings C++17
« Reply #1 on: April 08, 2019, 03:49:24 pm »
Good catch.  Looks like we missed the for loop style colon declaration when we added support for C++17 structured bindings.  I'll file a bug report and try to get this fixed in the next release.  It is not hot-fixable.