So sue me for trying to help you get in touch with someone who could give you an authoritative answer
Move away from the keyboard and go have some fun.
So sue me for trying to help you get in touch with someone who could give you an authoritative answer
[font="Verdana"]Hi, I think there's a possible bug in the c++ compiler that ships with vs 2010. I tried the same code in gcc and it worked fine (unless I was compiling it wrong...). The bug can be reproduced with the following code:
[/font]
[font="Verdana"]
template <typename T> struct A { void f1(){} void f1() const {} };
template <typename T> struct B : A<T> { using A<T>::f1; };
struct __declspec(dllexport) C : B<int> {};[/font][/quote][font="Verdana"] [/font][font="Verdana"]
[/font][font="Verdana"]I have no clue what happens here, or whether it's a bug or not. The best I can deduce is that A<T>::f1 is invalid as per spec and should be A::f1. But that aside:
template <typename T> struct [/font][font="Verdana"]__declspec(dllexport) [/font][font="Verdana"]A { void f1(){} void f1() const {} };
template <typename T> struct [/font][font="Verdana"]__declspec(dllexport) [/font][font="Verdana"]B : A<T> { using A<T>::f1; };
struct __declspec(dllexport) C : B<int> {};
[/font]
[font="Verdana"]
Export everything explicitly. There might be an issue with declspec being applied automatically and somehow breaking something.[/font]
Just wish some people wouldn't nit pick.
Bug in visual c++ 2010 with standard conforming code.
[/quote]
This a moronic claim; calling you on that isn't a nitpick. First off you claim that the code that you used was the same, and then admit that you did in fact use different code on the different compilers. It's a severe logic error that different code on a different compiler is supposed to tell you how vendor specific code on another compiler is supposed to work to the extent that you claim that it's a bug in their compiler. Furthermore, you obviously don't understand what the standard is and is supposed to do. If you don't want to learn, fine, but don't try to claim that your misused terminology isn't to blame for communication problems. If you want discussion to focus on your code, then don't aggressively claim that the first place people should be looking is for standards compliance problems in a compiler implementation. Instead of claiming up front that this code should work and it's a bug in the compiler that it doesn't, simply say the code doesn't work and ask why.
Basically saying "Way to miss the point" when you made it abundantly clear that you thought the problem was standards compliance is just acting like a dick. And then trivializing your communications errors as other people nitpicking continues that trend. Rate --.
Put __declspec in front of A and B as well.
Issue created on connect, it would have been nice if the OP updated the post to reflect this.
This a moronic claim; calling you on that isn't a nitpick. First off you claim that the code that you used was the same, and then admit that you did in fact use different code on the different compilers. It's a severe logic error that different code on a different compiler is supposed to tell you how vendor specific code on another compiler is supposed to work to the extent that you claim that it's a bug in their compiler. Furthermore, you obviously don't understand what the standard is and is supposed to do. If you don't want to learn, fine, but don't try to claim that your misused terminology isn't to blame for communication problems. If you want discussion to focus on your code, then don't aggressively claim that the first place people should be looking is for standards compliance problems in a compiler implementation. Instead of claiming up front that this code should work and it's a bug in the compiler that it doesn't, simply say the code doesn't work and ask why.
Basically saying "Way to miss the point" when you made it abundantly clear that you thought the problem was standards compliance is just acting like a dick. And then trivializing your communications errors as other people nitpicking continues that trend. Rate --.
Aw common dude. I just saw that MS acknowledged my feedback!! I was not monitoring that thing 24/7 you know... :/ And I was not going to post here that the issue was posted there before I was sure it was actually something solid. But yeah it turns out it's a bug in VC and it'll be resolved in the next version. It would be interesting to see what was going wrong on the backend though.