Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Find References on methods preceded by macro

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
chrisaverage Posted - Sep 12 2017 : 08:45:36 AM
Find References does not find results when invoked on a method call that is preceded by a macro:

#define FOO

void bar()
{
   FOO bazz(); //Find References doesn't work on bazz()
}

A workaround is to go to bazz() declaration first and invoke find references there, but it should be possible directly.

This is especially annoying when working with Qt framework, as it uses "emit" macro that expands to nothing to denote method calls that act as signal emitter.
6   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Sep 17 2017 : 11:53:57 AM
Thank you for the test project. I was able to reproduce your problem and I have put in a bug report for this.

case=111132
chrisaverage Posted - Sep 13 2017 : 3:48:16 PM
I've sent a sample - case number 111075. It's just a bare bones console app with the above code.
accord Posted - Sep 13 2017 : 1:08:06 PM
Thank you for taking the time looking into this. I still get the correct result using your samples using your 3 files.

If you created a new sample project, can you please zip it up and send it in? You can use the below form to send the files.
https://www.wholetomato.com/support/contact.asp

Please paste the URL of this topic into the "Your Request" field.
chrisaverage Posted - Sep 12 2017 : 4:32:04 PM
Ok, I've got a reproducible example. There are couple of necessary conditions:
- The class needs to be in proper h/cpp files. The problem doesn't occur when it's in a single cpp.
- The method in question needs to be in another cpp file (Qt generates signal method's bodies to a separate file).

Here's a sample:
//main.cpp
#include "TestClass.h"
int main()
{
    TestClass t;
    t.foo();
}

//TestClass.h
#pragma once
class TestClass
{
public:
    void foo();
    void bar();
};

//TestClass.cpp
#include "TestClass.h"
#define FOO
void TestClass::bar()
{
    FOO foo(); //this is the troubled place
}

//Generated.cpp
#pragma once
#include "TestClass.h"
void TestClass::foo() {}

So without the FOO macro I get the correct result:



And when I add the macro I only get this:




chrisaverage Posted - Sep 12 2017 : 3:40:15 PM
Right, it works in the simple example I gave. Sorry about that. Apparently a repro is more involved. I'm experiencing it in a large solution.
I'll try to extract the problem to a small example and will post back.

I'm using VS2017 (v 15.3.3) and Visual Assist build 2231, but it's also present in VS2012.
accord Posted - Sep 12 2017 : 12:30:55 PM
What version of Visual Assist and Visual Studio are you using? Triggering Find References on bazz() inside bar() works for me using VS2015 update 3 and Visual Assist build 2231.



Can you please try creating a clean new win32 project and paste the below sample there to see if it makes any difference for you?

void bazz()
{
	
}

#define FOO

void bar()
{
	FOO bazz(); //Find References doesn't work on bazz()
}

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000