We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c994155 + 4ef7eb2 commit 8f56486Copy full SHA for 8f56486
docs/error-messages/compiler-errors-2/compiler-error-c2526.md
@@ -1,13 +1,26 @@
1
---
2
description: "Learn more about: Compiler Error C2526"
3
title: "Compiler Error C2526"
4
-ms.date: "11/04/2016"
+ms.date: "03/08/2024"
5
f1_keywords: ["C2526"]
6
helpviewer_keywords: ["C2526"]
7
-ms.assetid: 0f8c554c-f990-457e-bcae-b6f273481825
8
9
# Compiler Error C2526
10
11
'identifier1' : C linkage function cannot return C++ class 'identifier2'
12
13
A function defined with C linkage cannot return a user-defined type.
+
14
+The following sample generates C2526:
15
16
+```cpp
17
+// C2526.cpp
18
+// compile with: /c
19
+template <typename T>
20
+class A {};
21
22
+extern "C" A<int> func() // C2526
23
+{
24
+ return A<int>();
25
+}
26
+```
0 commit comments