Skip to content

Commit d3d9f24

Browse files
author
Colin Robertson
committed
Update text for pragma deprecated
1 parent 340a494 commit d3d9f24

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/preprocessor/deprecated-c-cpp.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ The **deprecated** pragma lets you indicate that a function, type, or any other
4444
## Syntax
4545

4646
```
47-
4847
#pragma deprecated( identifier1 [,identifier2, ...] )
4948
```
5049

5150
## Remarks
52-
When the compiler encounters a deprecated symbol, it issues [C4995](../error-messages/compiler-warnings/compiler-warning-level-3-c4995.md).
51+
When the compiler encounters an identifier specified by a **deprecated** pragma, it issues compiler warning [C4995](../error-messages/compiler-warnings/compiler-warning-level-3-c4995.md).
5352

5453
You can deprecate macro names. Place the macro name in quotes or else macro expansion will occur.
5554

56-
The [deprecated](../cpp/deprecated-cpp.md) `__declspec` modifier allows you to specify deprecated status for particular forms of overloaded functions.
55+
Because the **deprecated** pragma works on all matching identifiers, and does not take signatures into account, it is not the best option for deprecating specific versions of overloaded functions. Any matching function name that is brought into scope triggers the warning.
56+
57+
We recommend you use the C++14 `[[deprecated]]` attribute, when possible, instead of the **deprecated** pragma. The Microsoft-specific [__declspec(deprecated)](../cpp/deprecated-cpp.md) declaration modifier is also a better choice in many cases than the **deprecated** pragma. The `[[deprecated]]` attribute and `__declspec(deprecated)` modifier allow you to specify deprecated status for particular forms of overloaded functions. The diagnostic warning only appears on references to the specific overloaded function the attribute or modifier applies to.
5758

5859
## Example
5960

0 commit comments

Comments
 (0)