T O P I C R E V I E W |
Towkin |
Posted - Sep 20 2017 : 07:52:10 AM Visual Studio Community 2015 - VA_X.dll file version 10.9.2231.0 built 2017.08.15 - DevEnv.exe version 14.0.25420.1 Community
In C++11, we got inherited constructors, which is very useful when extending a data-filled interface class with function set types. Simple and dumb example as follows:
struct Foo {
int i;
Foo(int _i): i(_i) {}
Foo(int a, int b): i(a + b) {}
};
struct FooPrinter: public Foo {
// Inherit constructors.
using Foo::Foo;
void print() { std::cout << i << "\n"; }
};
Which then allows the compilation of:
int main()
{
FooPrinter a(5);
a.print();
FooPrinter b(5, 10);
b.print();
return 0;
}
However, VA does not provide the constructor arguments when creating a new variable of FooPrinter, as seen here - as compared to this.
When I personally use inherited constructors, it's oftentimes because the base constructor is large, but as VA doesn't show me the arguments, I need to open up the base-class' .h-file to see what input it actually takes. Slightly annoying, but not detrimental for usage.
(Would this perhaps be more fitting posted as a feature request?) |
5 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Sep 20 2017 : 2:50:57 PM I am now seeing the same problems, and I think this is due to two different effects happening at the same time. We know that Constructor Inheritance is not yet supported in VA, and this is on our list of things to add to VA:
case=86375
Congratulations on being the first person to report this I didn't even know this was possible, so interesting to experiment and learn about it.
It looks like only seeing one constructor is an old, but sometimes hard to reproduce bug, so it is good to have another test case that shows this effect reliably:
case=8019 |
Towkin |
Posted - Sep 20 2017 : 12:19:16 PM quote: Originally posted by feline
So, what happens in your main solution? Are you seeing information for any of the constructors?
Also, are you inheriting a struct from a struct in your main solution? I know this is valid C++, but you virtually never see it done, so I was wondering.
Sorry if I wasn't clear enough.
The issue was slightly bigger than I remembered, clip available here: https://gfycat.com/FarWhisperedItaliangreyhound
My colleagues has the same thing occur, and we're on very similar setups.
Also: yes, we do use struct inheritance if the inherited type is an extended data set, and sometimes to use the private data design pattern. We're not particularly strict with what should be struct or class, oftentimes we see a struct evolve into class-like behavior over time, just that no-one thought to change it. |
feline |
Posted - Sep 20 2017 : 11:25:12 AM So, what happens in your main solution? Are you seeing information for any of the constructors?
Also, are you inheriting a struct from a struct in your main solution? I know this is valid C++, but you virtually never see it done, so I was wondering. |
Towkin |
Posted - Sep 20 2017 : 09:31:56 AM quote: Originally posted by feline
What do you have:
VA Options -> Enhanced Listboxes -> Source of C/C++ content
set to? Visual Assist OR Default Intellisense?
I am seeing the parameter information from the IDE in this situation, the clue is that the tooltips have up and down triangles to move through the overloads, which is something the IDE does.
It is set to Visual Assist, as seen here. I'll provide some more information if it would help an investigation:
VA_X.dll file version 10.9.2231.0 built 2017.08.15 DevEnv.exe version 14.0.25420.1 Community msenv.dll version 14.0.25431.1 Comctl32.dll version 6.10.7601.18837 Windows 7 6.1 Build 7601 Service Pack 1 4 processors (x86-64, WOW64) Language info: 1252, 0x409
EDIT: It's really weird, it would seem the parameter information, in this specific scenario, only provides the latest of the declared (/defined, if defined in the same file) constructor parameters. This particular issue does not happen in our main working solution, however, the issue with 'using BaseClass::BaseClass' still applies there. |
feline |
Posted - Sep 20 2017 : 08:30:04 AM What do you have:
VA Options -> Enhanced Listboxes -> Source of C/C++ content
set to? Visual Assist OR Default Intellisense?
I am seeing the parameter information from the IDE in this situation, the clue is that the tooltips have up and down triangles to move through the overloads, which is something the IDE does. |
|
|