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/Swig | |
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/Swig')
-rw-r--r-- | Source/Swig/naming.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Swig/naming.c b/Source/Swig/naming.c index 517b056a7..4d7d89340 100644 --- a/Source/Swig/naming.c +++ b/Source/Swig/naming.c @@ -997,7 +997,7 @@ static int nodes_are_equivalent(Node *a, Node *b, int a_inclass) { /* friend methods */ - if (!a_inclass || (Cmp(a_storage, "friend") == 0)) { + if (!a_inclass || Strstr(a_storage, "friend")) { /* check declaration */ String *a_decl = (Getattr(a, "decl")); @@ -1056,7 +1056,7 @@ static int nodes_are_equivalent(Node *a, Node *b, int a_inclass) { return 0; } if (Equal(ta, "template") && Equal(tb, "template")) { - if (Cmp(a_storage, "friend") == 0 || Cmp(b_storage, "friend") == 0) + if (Strstr(a_storage, "friend") || Strstr(b_storage, "friend")) return 1; } } |