diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-10-02 13:47:15 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-10-05 22:42:17 +0100 |
commit | ba279ae9392b36e2de857a08a4f5266c27b5c930 (patch) | |
tree | e6666df360d6dbde9c4366855da236ed849a25b5 /Doc | |
parent | 76f5670fa47d85ddc1a4a87cf94b2c8b568d3f11 (diff) | |
download | swig-ba279ae9392b36e2de857a08a4f5266c27b5c930.tar.gz |
Add support for parsing C++11 final classes
Such as:
class X final {};
This no longer gives a syntax error.
This change has introduced one more shift-reduce conflict in the parser.
with a conflict with a C style variable declaration with name final:
class X final;
resulting in a syntax error (for C++ not C). This is an an unusual style
for C++ code and more typical declarations do work:
X final;
Closes #672
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Manual/CPlusPlus11.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/Manual/CPlusPlus11.html b/Doc/Manual/CPlusPlus11.html index 861b80048..a84ca5f51 100644 --- a/Doc/Manual/CPlusPlus11.html +++ b/Doc/Manual/CPlusPlus11.html @@ -891,6 +891,19 @@ struct DerivedStruct : BaseStruct { }; </pre></div> +<p> +Classes can also be marked as final, such as +</p> + +<div class="code"><pre> +struct FinalDerivedStruct final : BaseStruct { + virtual void ab() const override; +}; +</pre></div> + +<p> +<b>Compatibility note:</b> Final methods were supported much earlier than final classes. SWIG-4.1.0 was the first version to support classes marked as final. +</p> <H3><a name="CPlusPlus11_null_pointer_constant">7.2.12 Null pointer constant</a></H3> |