Skip to content

Commit 8d66e00

Browse files
authored
Update c26435.md
Documentation improvement motivated by https://developercommunity.visualstudio.com/t/Warning-C26435-contradicts-to-Compiler-E/10355159 When a `virtual` function declaration includes the `final` specifier, the warning message for C26435 incorrectly suggested specifying exactly one of the two. The correct solution is to specify zero of the two. The warning message has been updated in MSVC and this documentation change reflects that as well as provides an example of how to fix the incorrect pattern.
1 parent 2323822 commit 8d66e00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/code-quality/c26435.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ helpviewer_keywords: ["C26435"]
77
---
88
# Warning C26435
99

10-
> Function '*symbol*' should specify exactly one of 'virtual', 'override', or 'final' (c.128)
10+
> The virtual function '*symbol*' should specify exactly one of 'virtual', 'override', or 'final' (c.128)
1111
1212
## C++ Core Guidelines
1313

@@ -41,6 +41,9 @@ public:
4141
void Draw() override final { // C26435, only 'final' is necessary.
4242
//...
4343
}
44+
virtual void DrawCircumference() final { // C26435, should be neither 'virtual' nor 'final'.
45+
//...
46+
}
4447
};
4548
```
4649

0 commit comments

Comments
 (0)