Author |
Topic |
|
yym
Senior Member
Israel
31 Posts |
Posted - Oct 19 2014 : 10:11:53 AM
|
VA build 2048, VS2008
Using a reference to a template parameter as the return type for a function appears to confuse the VA parser:
class C
{
public:
template<class T>
struct D
{
int i;
};
template<class T>
T& f(const D<T>& d);
int g();
int j;
};
template<class T>
T& C::f(const D<T>& d)
{
return d.i;
}
int C::g()
{
return j;
}
The D and d in C::f are underlined, and even the j in C::g (and every other function following C::f in the file) is not recognised.
If I remove the & from the return type there is no problem. |
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Oct 20 2014 : 10:26:06 PM
|
I tried your sample code but unfortunately, I wasn't able to reproduce the problem. So I will ask more question which may shed some light to the problem.
1. Can you please try creating a clean new win32 test project to see if you are able to reproduce the problem by copy-pasting this code there? Are you seeing the problem now?
2. Which extension are you using for your file where it happens? (I tried .cpp and .h)
3. Are you using any other Visual Studio extensions?
4. Are you using C++ or C++/CLI (CLR)?
5. Can you please move the caret over the j in the C::g() method? |
Edited by - accord on Oct 20 2014 10:26:59 PM |
|
|
yym
Senior Member
Israel
31 Posts |
Posted - Oct 26 2014 : 06:48:41 AM
|
1. I created a new empty Win32 console project, added a file (main.cpp), pasted the code in and typed a space (to trigger the parser) and after a couple of seconds the red underlines appeared. 2. .cpp 3. SourceGear Vault plugin (not using it but it is installed). CodeJock Xtreme Toolkit. I have had the Qt extension installed, but I have since removed it. 4. C++ 5. It shows the refactoring menu with the option to create a variable j. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Nov 07 2014 : 6:40:17 PM
|
This is odd. Since this is happening at the parser level (e.g. unrecognized j), other extensions shouldn't matter. My 5th question was incomplete, but your answer was still helpful The option to create a variable j suggests that VA does not recognize the variable.
If the problem also happens in a new project, I should be able to reproduce...
First, can you please try rebuilding your symbol databases?
VA Options -> Performance -> Rebuild
Does it make any difference?
If you're still seeing the problem in your test solution, can you please send it in along with your exported settings, to see if I can reproduce the problem using them?
1. VA Options -> Performance -> Export Settings
2. IDE tools menu -> Import and Export Settings -> Export selected environment settings
3. Zip up the solution
4. Send in the 3 files using the below form: http://www.wholetomato.com/support/contact.asp
Please paste the URL of this topic to the "Your Request" field so we can match it up. |
|
|
yym
Senior Member
Israel
31 Posts |
Posted - Nov 09 2014 : 04:57:59 AM
|
Sorry for sending you on a wild goose chase. It turns out that a few more factors are needed to trigger the problem. I was misled by the fact that once the problem occurs, it remains even if the cause is removed, sometimes until VS is restarted and sometimes until the symbol database is rebuilt.
I have sent a modified solution which exhibits the problem, and the settings files. Note that I have the boost include directory in my "Stable include files". If I take it out, the problem goes away. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Nov 10 2014 : 9:53:16 PM
|
Thank you for the files and the explanation. I was now able to reproduce the problem:
case=86229 |
Edited by - accord on Nov 10 2014 9:54:14 PM |
|
|
|
Topic |
|