description | title | ms.date | f1_keywords | helpviewer_keywords | ||
---|---|---|---|---|---|---|
Learn more about: Compiler Error C2526 |
Compiler Error C2526 |
03/08/2024 |
|
|
'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>();
}