https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109568
Andrew Pinski changed:
What|Removed |Added
Summary|[12/13/14 Regression] |Spurious "potential null
|Spurious "potential null|pointer dereference" in
|pointer dereference" in |shared_ptr_base.h with
|shared_ptr_base.h with |"-O1"
|"-O1" |
Component|libstdc++ |tree-optimization
Target Milestone|12.3|---
--- Comment #6 from Andrew Pinski ---
This has nothing to do with libstd++, a similar warning can happen with:
struct Base {
virtual ~Base() = default;
int b = 0;
};
struct Derived : public Base {};
bool empty(Base* var) {
auto* var_ref = dynamic_cast(var);
if (var_ref->b) return false;
return true;
}