Compiler Error C2526
'identifier1' : C linkage function cannot return C++ class 'identifier2'
A function defined with C linkage cannot return a user-defined type.
The following sample generates C2526:
// C2526.cpp
// compile with: /c
template <typename T>
class A {};
extern "C" A<int> func() // C2526
{
return A<int>();
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for