Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 __declspec(selectany) in wrong location
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

FitzyDog
Senior Member

25 Posts

Posted - Aug 18 2010 :  9:37:10 PM  Show Profile  Reply with Quote
Just reporting a minor bug:

With this code:

template<class ComponentClassType>
struct unique_per_component
{
static Type component_type;
};

Right clicking on component_type and hitting "create implementation"
creates the following code..

__declspec(selectany) template<class ComponentClassType>
Type cmp::unique_per_component<ComponentClassType>::component_type;

This code does not compile(the selectany is in the wrong location). This is what is supposed to look like.

template<class ComponentClassType>
__declspec(selectany) Type cmp::unique_per_component<ComponentClassType>::component_type;

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 19 2010 :  04:01:28 AM  Show Profile  Reply with Quote
Which version of Visual Assist are you using? I got different result with 1830. What is the definition of "Type"? It might be a factor.

I got this:

template<class ComponentClassType>
struct unique_per_component
{
	static int component_type;
};

template<class ComponentClassType>
int unique_per_component<ComponentClassType>::component_type;

and it compiles.
Go to Top of Page

dgehri
Senior Member

Switzerland
43 Posts

Posted - Jul 19 2012 :  08:02:13 AM  Show Profile  Reply with Quote
This still doesn't work as of version 10.7.1908.0 built 2012.05.31
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Jul 19 2012 :  11:46:24 PM  Show Profile  Reply with Quote
Sorry to hear this.
In order to be able to fix it, we will need to be able to reproduce the problem first here, internally. My previous post may shed a light on what is the missing link.
If you could piece together a small example source that can be compiled and used to reproduce the problem, it would be the best.
Unfortunately, problems do not always appear when the source is moved out of context. For example, into a new test project.

Edited by - accord on Jul 19 2012 11:48:56 PM
Go to Top of Page

maorkh4
Starting Member

Israel
1 Posts

Posted - Mar 28 2018 :  08:49:59 AM  Show Profile  Reply with Quote
Hello!

The problem still persists as of 10.9.2258.5 built 2018.03.06 (VS 2015 Professional 14.0.25431.01 Update 3).

In order to reproduce the problem, please look at the following example:

template <typename ArithmeticType>
struct Yak
{
static_assert(std::is_arithmetic_v<ArithmeticType>, "Type must be arithmetic");

static ArithmeticType num;
};

Right clicking on num static member and and pressing "Create Implementation" will produce the following code:

__declspec(selectany) template <typename ArithmeticType>
ArithmeticType Yak<ArithmeticType>::num;

This code does not compile since the correct syntax is:

template <typename ArithmeticType> __declspec(selectany)
ArithmeticType Yak<ArithmeticType>::num;

Meaning __declspec(selectany) was put in the wrong location.

Notice that in accord's example there's no use of the template parameter in the static member declaration and that's why problem did not reproduce.
Please use my code here to reproduce the problem.

Thanks!

Edited by - maorkh4 on Mar 28 2018 09:07:50 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17012 Posts

Posted - Mar 28 2018 :  10:20:39 AM  Show Profile  Reply with Quote
Thank you for the clear example, and description, I am seeing the same problem here, now I know what to try and what to do, so I have put in a bug report for this:

case=115411

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 24 2018 :  2:14:23 PM  Show Profile  Reply with Quote
case=115411 is fixed in build 2291.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000