@@ -224,6 +224,20 @@ class ObjectWithMutatingDestructor {
224224 Number n;
225225};
226226
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+
227241class RefCounted {
228242public:
229243 void ref () const ;
@@ -336,6 +350,8 @@ class RefCounted {
336350 unsigned trivial60 () { return ObjectWithNonTrivialDestructor { 5 }.value (); }
337351 unsigned trivial61 () { return DerivedNumber (' 7' ).value (); }
338352 void trivial62 () { WTFReportBacktrace (); }
353+ SomeType trivial63 () { return SomeType (0 ); }
354+ SomeType trivial64 () { return SomeType (); }
339355
340356 static RefCounted& singleton () {
341357 static RefCounted s_RefCounted;
@@ -425,6 +441,7 @@ class RefCounted {
425441 unsigned nonTrivial21 () { return Number (" 123" ).value (); }
426442 unsigned nonTrivial22 () { return ComplexNumber (123 , " 456" ).real ().value (); }
427443 unsigned nonTrivial23 () { return DerivedNumber (" 123" ).value (); }
444+ SomeType nonTrivial24 () { return SomeType (" 123" ); }
428445
429446 static unsigned s_v;
430447 unsigned v { 0 };
@@ -515,6 +532,8 @@ class UnrelatedClass {
515532 getFieldTrivial ().trivial60 (); // no-warning
516533 getFieldTrivial ().trivial61 (); // no-warning
517534 getFieldTrivial ().trivial62 (); // no-warning
535+ getFieldTrivial ().trivial63 (); // no-warning
536+ getFieldTrivial ().trivial64 (); // no-warning
518537
519538 RefCounted::singleton ().trivial18 (); // no-warning
520539 RefCounted::singleton ().someFunction (); // no-warning
@@ -587,6 +606,8 @@ class UnrelatedClass {
587606 // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
588607 getFieldTrivial ().nonTrivial23 ();
589608 // 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}}
590611 }
591612
592613 void setField (RefCounted*);
0 commit comments