Home Dashboard Directory Help
Search

“Dependent Name is not a Type”, but prefixing with “typename” causes compiler crash by aguazales


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 794182
Opened: 7/16/2013 4:50:01 PM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description


I have the following templated class:

#include <list>

template<class T> class CDFAManListOps
{
    static typename std::list<T>::iterator CDFAManListOps::GetIterator(std::list<T>* list, int pId)
    {
    }

    static typename std::list<T>::iterator CDFAManListOps::GetIterator(std::list<T>* list, T object)
    {

    }
};

int main()
{

}

When I build this file, the compiler crashes. If EITHER of the two GetIterator functions is removed, the program compiles and runs fine. Only when BOTH functions are present will the compiler crash. Also, removing the class names from the functions fixes the problem (see the workaround I posted).
Details
Sign in to post a comment.
Posted by aguazales on 7/26/2013 at 5:39 PM
Noted. Thank you for your response.
Posted by Microsoft on 7/26/2013 at 4:48 PM
Hi aguazales,

Thank you for taking the time to provide your feedback. After reviewing your reported issue, in the context of all the issues reported to us, we have decided not to take any action on this feedback at this time. We will re-consider our decision for a future release. In the meantime, use the workaround.

If this issue is severe, causing critical business situations or blocking your product development or deployment, please go to http://support.microsoft.com or call 1-800-MICROSOFT for assistance.
For Microsoft premier customers, please contact your administrator, your Technical Account Manager, or your Microsoft premier account representative.

Thanks,
Karl Niu
VC++ Team
Posted by Microsoft on 7/16/2013 at 11:50 PM
Thank you for submitting feedback on Visual Studio 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 Microsoft on 7/16/2013 at 5:53 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)
Sign in to post a workaround.
Posted by aguazales on 7/16/2013 at 4:52 PM
Removing the class names from the functions solves the problem:

ie this will compile:

#include <list>
template<class T> class CDFAManListOps
{
    static typename std::list<T>::iterator GetIterator(std::list<T>* list, int pId) {}
    static typename std::list<T>::iterator GetIterator(std::list<T>* list, T object) {}
};
int main() {}