C++ compiler bug in certain situation involving using declaration and overloaded base member functions - by ifoobar

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 685461 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 8/24/2011 3:04:38 PM
Access Restriction Public


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 (mac and linux). The bug can be reproduced with the following code:

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> {};

The error you get is error C2487: member of dll interface class may not be declared with dll interface. But, I do not see how that applies in this situation. If you remove the using statement in B then the error goes, and if you remove either overload of the member function of A the error also goes away. 

So I guess it's more because of the overloaded member function in A and not B. Also, if you inherit directly from A then the error also disappears. 
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:23 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Microsoft on 8/25/2011 at 12:07 PM
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by MS-Moderator10 [Feedback Moderator] on 8/24/2011 at 8:11 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 8/24/2011 at 8:03 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)