Failed to specialize function template - by Jalf1

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.


1
0
Sign in
to vote
ID 781537 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 3/17/2013 3:39:26 PM
Access Restriction Public

Description

The code listed below is valid to the best of my knowledge, and compiles under both Clang and GCC.

However, Visual C++ produces a cryptic error message instead:

error C2893: Failed to specialize function template 'S::val> foo(T)'

The problem only occurs if the struct S is templated on an enum type. Change it to 'template <int e>' instead, and it compiles just fine.

I posted about the eror here as well:
http://stackoverflow.com/questions/15466594/why-does-msvc-fail-to-compile-this-template-function
Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:29 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 3/29/2013 at 3:13 PM
Hello,
The fix will be available in the next major VS release.
You could check http://blogs.msdn.com/vcblog for future announcements on the timeframe for this next major release.

Thanks,
Nada, C++ Team
Posted by Jalf1 on 3/22/2013 at 12:38 PM
Thanks! That sounds good.

What does "the next release of Visual C++" mean though? Does this include the quarterly(ish) updates, or a service pack, or the next major release?
Posted by Xiang [MSFT] on 3/22/2013 at 12:30 PM
Hi:
    Thanks for reporting the issue.
    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 Helen [MSFT] on 3/17/2013 at 10:43 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Helen [MSFT] on 3/17/2013 at 3:52 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)