Skip to content

Commit 059bb0c

Browse files
Thomas REITMAYRtreitmayr
authored andcommitted
Recognize C++ conversion operators with trailing '= 0' as abstract
This fix is done for all supported variants of user-defined conversion operators and fixes swig#1723.
1 parent e3524be commit 059bb0c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Source/CParse/parser.y

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4800,6 +4800,9 @@ cpp_conversion_operator : storage_class CONVERSIONOPERATOR type pointer LPAREN p
48004800
if ($8.qualifier) {
48014801
SwigType_push($4,$8.qualifier);
48024802
}
4803+
if ($8.val) {
4804+
Setattr($$,"value",$8.val);
4805+
}
48034806
Setattr($$,"refqualifier",$8.refqualifier);
48044807
Setattr($$,"decl",$4);
48054808
Setattr($$,"parms",$6);
@@ -4818,6 +4821,9 @@ cpp_conversion_operator : storage_class CONVERSIONOPERATOR type pointer LPAREN p
48184821
if ($8.qualifier) {
48194822
SwigType_push(decl,$8.qualifier);
48204823
}
4824+
if ($8.val) {
4825+
Setattr($$,"value",$8.val);
4826+
}
48214827
Setattr($$,"refqualifier",$8.refqualifier);
48224828
Setattr($$,"decl",decl);
48234829
Setattr($$,"parms",$6);
@@ -4836,6 +4842,9 @@ cpp_conversion_operator : storage_class CONVERSIONOPERATOR type pointer LPAREN p
48364842
if ($8.qualifier) {
48374843
SwigType_push(decl,$8.qualifier);
48384844
}
4845+
if ($8.val) {
4846+
Setattr($$,"value",$8.val);
4847+
}
48394848
Setattr($$,"refqualifier",$8.refqualifier);
48404849
Setattr($$,"decl",decl);
48414850
Setattr($$,"parms",$6);
@@ -4856,6 +4865,9 @@ cpp_conversion_operator : storage_class CONVERSIONOPERATOR type pointer LPAREN p
48564865
if ($9.qualifier) {
48574866
SwigType_push(decl,$9.qualifier);
48584867
}
4868+
if ($9.val) {
4869+
Setattr($$,"value",$9.val);
4870+
}
48594871
Setattr($$,"refqualifier",$9.refqualifier);
48604872
Setattr($$,"decl",decl);
48614873
Setattr($$,"parms",$7);
@@ -4873,7 +4885,10 @@ cpp_conversion_operator : storage_class CONVERSIONOPERATOR type pointer LPAREN p
48734885
if ($7.qualifier) {
48744886
SwigType_push(t,$7.qualifier);
48754887
}
4876-
Setattr($$,"refqualifier",$7.refqualifier);
4888+
if ($7.val) {
4889+
Setattr($$,"value",$7.val);
4890+
}
4891+
Setattr($$,"refqualifier",$7.refqualifier);
48774892
Setattr($$,"decl",t);
48784893
Setattr($$,"parms",$5);
48794894
Setattr($$,"conversion_operator","1");

0 commit comments

Comments
 (0)