Skip to content

Commit d385365

Browse files
authored
Merge pull request #5245 from Rageking8/update-c2640-error-reference
Update C2640 error reference
2 parents cbfd3bc + dba96f9 commit d385365

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
---
2-
description: "Learn more about: Compiler Error C2640"
32
title: "Compiler Error C2640"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2640"
4+
ms.date: "03/17/2025"
55
f1_keywords: ["C2640"]
66
helpviewer_keywords: ["C2640"]
7-
ms.assetid: e4d137ab-ed1d-457c-9eec-b70d97f1b0b4
87
---
98
# Compiler Error C2640
109

11-
'identifier' : __based modifier illegal on reference
10+
> 'abstract declarator': __based modifier illegal on reference
1211
13-
The **`__based`** modifier can be used on pointers only.
12+
The [**`__based`**](../../cpp/based-pointers-cpp.md) modifier can be used on pointers only.
1413

1514
The following sample generates C2640:
1615

1716
```cpp
1817
// C2640.cpp
19-
void f(int i) {
20-
void *vp;
21-
int _based(vp) &vr = I; // C2640
18+
int* ptr;
19+
20+
int main()
21+
{
22+
int __based(ptr)& based_ref; // C2640
23+
int __based(ptr)* based_ptr; // OK
2224
}
2325
```

docs/error-messages/compiler-errors-2/compiler-errors-c2600-through-c2699.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler errors C2600 Through C2699"
32
title: "Compiler errors C2600 Through C2699"
3+
description: "Learn more about: Compiler errors C2600 Through C2699"
44
ms.date: "04/21/2019"
55
f1_keywords: ["C2604", "C2606", "C2607", "C2608", "C2609", "C2610", "C2615", "C2618", "C2620", "C2621", "C2622", "C2623", "C2625", "C2629", "C2631", "C2639", "C2641", "C2642", "C2643", "C2644", "C2684", "C2685", "C2686", "C2697"]
66
helpviewer_keywords: ["C2604", "C2606", "C2607", "C2608", "C2609", "C2610", "C2615", "C2618", "C2620", "C2621", "C2622", "C2623", "C2625", "C2629", "C2631", "C2639", "C2641", "C2642", "C2643", "C2644", "C2684", "C2685", "C2686", "C2697"]
@@ -55,7 +55,7 @@ The articles in this section of the documentation explain a subset of the error
5555
|[Compiler error C2637](compiler-error-c2637.md)|'*identifier*': cannot modify pointers to data members|
5656
|[Compiler error C2638](compiler-error-c2638.md)|'*identifier*': __based modifier illegal on pointer to member|
5757
|Compiler error C2639|trailing return type '*type*' of deduction guide should be a specialization of '*class template*'|
58-
|[Compiler error C2640](compiler-error-c2640.md)|'*identifier*': __based modifier illegal on reference|
58+
|[Compiler error C2640](compiler-error-c2640.md)|'abstract declarator': __based modifier illegal on reference|
5959
|Compiler error C2641|cannot deduce template arguments for '*template name*'|
6060
|Compiler error C2642|two deduction guide declarations for the same class template cannot have equivalent parameter list and template head|
6161
|Compiler error C2643|deduction guide should be declared in the same scope as the corresponding class template '*template name*'|

0 commit comments

Comments
 (0)