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.
1 parent 61d8ea5 commit e1359dbCopy full SHA for e1359db
docs/error-messages/compiler-errors-2/compiler-error-c2526.md
@@ -1,13 +1,24 @@
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
+```cpp
15
+// C2526.cpp
16
+// compile with: /c
17
+template <typename T>
18
+class A {};
19
20
+extern "C" A<int> func() // C2526
21
+{
22
+ return {};
23
+}
24
+```
0 commit comments