File tree Expand file tree Collapse file tree 3 files changed +24
-9
lines changed Expand file tree Collapse file tree 3 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -2233,6 +2233,9 @@ def parse_method_type(self, stack):
2233
2233
info ["pure_virtual" ] = True
2234
2234
elif stack [- 2 ] == "delete" :
2235
2235
info ["deleted" ] = True
2236
+ elif stack [- 2 ] == "default" :
2237
+ info ["default" ] = True
2238
+ info ["defined" ] = True
2236
2239
2237
2240
r = header .split ()
2238
2241
name = None
@@ -2274,15 +2277,9 @@ def parse_method_type(self, stack):
2274
2277
2275
2278
if name .startswith ("~" ):
2276
2279
info ["destructor" ] = True
2277
- if "default;" in stack :
2278
- info ["defined" ] = True
2279
- info ["default" ] = True
2280
2280
name = name [1 :]
2281
2281
elif not a or (name == self .curClass and len (self .curClass )):
2282
2282
info ["constructor" ] = True
2283
- if "default;" in stack :
2284
- info ["defined" ] = True
2285
- info ["default" ] = True
2286
2283
2287
2284
info ["name" ] = name
2288
2285
Original file line number Diff line number Diff line change @@ -780,13 +780,13 @@ int non_vararg_func(int foo, const char* fmt);
780
780
class DefaultConstDest {
781
781
public:
782
782
DefaultConstDest () =default ; // spacing check
783
- DefaultConstDest () = default ; // spacing check
783
+ ~ DefaultConstDest () = default ; // spacing check
784
784
};
785
785
// default constructor on a class containing "default" as name (edge case check)
786
786
class default_class_tricky {
787
787
public:
788
788
default_class_tricky ();
789
- default_class_tricky ();
789
+ ~ default_class_tricky ();
790
790
791
791
void randomMethod1_default ();
792
792
void defaultrandomMethod2 ();
Original file line number Diff line number Diff line change @@ -2648,7 +2648,7 @@ def test_Grackle_const_noexcept_noexcept_operator(self):
2648
2648
2649
2649
2650
2650
# Test enhancement 13 (default constructor / destructor)
2651
- class DefaultConstDest_TestCase :
2651
+ class DefaultConstDest_TestCase ( unittest . TestCase ) :
2652
2652
def setUp (self ):
2653
2653
self .cppHeader = CppHeaderParser .CppHeader ("TestSampleClass.h" )
2654
2654
@@ -3807,6 +3807,24 @@ def test_fn(self):
3807
3807
self .assertEqual (props [1 ]["name" ], "y" )
3808
3808
3809
3809
3810
+ class Default_TestCase (unittest .TestCase ):
3811
+ def setUp (self ):
3812
+ self .cppHeader = CppHeaderParser .CppHeader (
3813
+ """
3814
+ class A {
3815
+ public:
3816
+ A() = default;
3817
+ };
3818
+ """ ,
3819
+ "string" ,
3820
+ )
3821
+
3822
+ def test_fn (self ):
3823
+ m = self .cppHeader .classes ["A" ]["methods" ]["public" ][0 ]
3824
+ self .assertEqual (m ["constructor" ], True )
3825
+ self .assertEqual (m ["default" ], True )
3826
+
3827
+
3810
3828
class Deleted_TestCase (unittest .TestCase ):
3811
3829
def setUp (self ):
3812
3830
self .cppHeader = CppHeaderParser .CppHeader (
You can’t perform that action at this time.
0 commit comments