Author Topic: C++ issue performing reference search on constructor  (Read 1787 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
C++ issue performing reference search on constructor
« on: February 25, 2019, 02:11:13 PM »
Look for constrefsearch.tar.gz on support. The README file contains instructions on how to repro the issue.

I'm using 23.0.1.1 on Linux x64, CentOS 7.2.
« Last Edit: February 25, 2019, 07:26:04 PM by rowbearto »

Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: C++ issue performing reference search on constructor
« Reply #1 on: February 26, 2019, 12:42:00 AM »
This will be fixed in a future hot fix for 23.0.1.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: C++ issue performing reference search on constructor
« Reply #2 on: February 26, 2019, 03:33:41 AM »
Thanks!

I also notice when I choose the constructor that the references search is showing me many things in its cc file that are not the constructor. I think it is not expected and will also be fixed in the hotfix?

Dennis

  • Senior Community Member
  • Posts: 3966
  • Hero Points: 517
Re: C++ issue performing reference search on constructor
« Reply #3 on: February 26, 2019, 03:43:11 PM »
There will be some improvements in that regard, but there are a lot of scenarios where an argument can be made equally for jumping to the class or the constructor, for example:

Code: [Select]
MyClass mc;   // cursor on MyClass

MyClass is a type, so clearly it should go to the class, but no, this is how 'mc' is constructed, so clearly it should go to the constructor, but no, there are no parenthesis, so this is in no way a function call, so it clearly should go to the class, but no, the parenthesis are implied, so clearly, it should go to the constructor, but no, it's possible the constructor is implicit, so clearly then we would have to go to the class.

Because of scenarios like this, I am very conservative about changes to the way tag navigation narrows things down.  For every user who wants more specificity, there are nine who will throw a fit when something they view as a valid reference is omitted.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: C++ issue performing reference search on constructor
« Reply #4 on: February 26, 2019, 03:48:35 PM »
I understand why you want to be conservative. For the example of "MyClass mc;" I would argue that both class search and constructor search should list this as both are applicable.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: C++ issue performing reference search on constructor
« Reply #5 on: February 26, 2019, 03:49:59 PM »
But at the same time a constructor references search would ideally (if you want to take some risk) not list the definitions of member functions of a class that are not the constructor, such as "void MyClass::myMemberFunc(){}"