[Sema] Fix missing warning on initializer lists on field initializers with overloaded operators

Differential Revision: https://reviews.llvm.org/D85574
This commit is contained in:
Zequan Wu 2020-08-10 18:51:09 -07:00
parent 9512525947
commit 4aaa977003
2 changed files with 17 additions and 1 deletions

View File

@ -3577,8 +3577,10 @@ namespace {
Base = SubME->getBase();
}
if (!isa<CXXThisExpr>(Base->IgnoreParenImpCasts()))
if (!isa<CXXThisExpr>(Base->IgnoreParenImpCasts())) {
Visit(Base);
return;
}
if (AddressOf && AllPODFields)
return;

View File

@ -1303,6 +1303,20 @@ namespace init_list {
d3{ d3.b, num } // expected-warning{{uninitialized}}
{}
};
struct E {
E();
E foo();
E* operator->();
};
struct F { F(E); };
struct EFComposed {
F f;
E e;
EFComposed() : f{ e->foo() }, e() {} // expected-warning{{uninitialized}}
};
}
namespace template_class {