forked from OSchip/llvm-project
[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:
parent
9512525947
commit
4aaa977003
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue