diff options
author | Olly Betts <olly@survex.com> | 2023-01-05 16:54:16 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2023-05-11 13:11:22 +1200 |
commit | 9c8d6563498bbfd22d05b225930409236834b867 (patch) | |
tree | 197887f358073c65a911882674c874ee4e17cd9a /Source/Modules/lang.cxx | |
parent | 38f8f15fcd4747cb1db136de74874dd779a75c6f (diff) | |
download | swig-parse-storage-class-flexibly.tar.gz |
Parse storage class more flexiblyparse-storage-class-flexibly
Previously we had a hard-coded list of allowed combinations in the
grammar, but this suffers from combinatorial explosion, and results
in a vague `Syntax error in input` error for invalid combinations.
This means we now support a number of cases which are valid C++
but weren't supported.
Fixes #302
Fixes #2079 (friend constexpr)
Fixes #2474 (virtual explicit)
Diffstat (limited to 'Source/Modules/lang.cxx')
-rw-r--r-- | Source/Modules/lang.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index 7a85c2d63..ba52e265c 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -882,7 +882,7 @@ int Language::cDeclaration(Node *n) { /* discards nodes following the access control rules */ if (cplus_mode != PUBLIC || !is_public(n)) { /* except for friends, they are not affected by access control */ - int isfriend = Cmp(storage, "friend") == 0; + int isfriend = (Strstr(storage, "friend") != NULL); if (!isfriend) { /* Check what the director needs. If the method is pure virtual, it is always needed. * Also wrap non-virtual protected members if asked for (allprotected mode). */ @@ -1061,7 +1061,7 @@ int Language::cDeclaration(Node *n) { int Language::functionHandler(Node *n) { String *storage = Getattr(n, "storage"); - int isfriend = CurrentClass && Cmp(storage, "friend") == 0; + int isfriend = CurrentClass && Strstr(storage, "friend"); int isstatic = CurrentClass && Swig_storage_isstatic(n) && !(SmartPointer && Getattr(n, "allocate:smartpointeraccess")); Parm *p = Getattr(n, "parms"); if (GetFlag(n, "feature:del")) { |