@@ -224,6 +224,20 @@ class ObjectWithMutatingDestructor {
224
224
Number n;
225
225
};
226
226
227
+ class BaseType {
228
+ public:
229
+ BaseType () : n(0 ) { }
230
+ BaseType (int v) : n(v) { }
231
+ BaseType (const char *);
232
+ private:
233
+ Number n;
234
+ };
235
+
236
+ class SomeType : public BaseType {
237
+ public:
238
+ using BaseType::BaseType;
239
+ };
240
+
227
241
class RefCounted {
228
242
public:
229
243
void ref () const ;
@@ -336,6 +350,8 @@ class RefCounted {
336
350
unsigned trivial60 () { return ObjectWithNonTrivialDestructor { 5 }.value (); }
337
351
unsigned trivial61 () { return DerivedNumber (' 7' ).value (); }
338
352
void trivial62 () { WTFReportBacktrace (); }
353
+ SomeType trivial63 () { return SomeType (0 ); }
354
+ SomeType trivial64 () { return SomeType (); }
339
355
340
356
static RefCounted& singleton () {
341
357
static RefCounted s_RefCounted;
@@ -425,6 +441,7 @@ class RefCounted {
425
441
unsigned nonTrivial21 () { return Number (" 123" ).value (); }
426
442
unsigned nonTrivial22 () { return ComplexNumber (123 , " 456" ).real ().value (); }
427
443
unsigned nonTrivial23 () { return DerivedNumber (" 123" ).value (); }
444
+ SomeType nonTrivial24 () { return SomeType (" 123" ); }
428
445
429
446
static unsigned s_v;
430
447
unsigned v { 0 };
@@ -515,6 +532,8 @@ class UnrelatedClass {
515
532
getFieldTrivial ().trivial60 (); // no-warning
516
533
getFieldTrivial ().trivial61 (); // no-warning
517
534
getFieldTrivial ().trivial62 (); // no-warning
535
+ getFieldTrivial ().trivial63 (); // no-warning
536
+ getFieldTrivial ().trivial64 (); // no-warning
518
537
519
538
RefCounted::singleton ().trivial18 (); // no-warning
520
539
RefCounted::singleton ().someFunction (); // no-warning
@@ -587,6 +606,8 @@ class UnrelatedClass {
587
606
// expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
588
607
getFieldTrivial ().nonTrivial23 ();
589
608
// expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
609
+ getFieldTrivial ().nonTrivial24 ();
610
+ // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
590
611
}
591
612
592
613
void setField (RefCounted*);
0 commit comments