[Bug c++/83990] [7/8 Regression] Spurious "potential null pointer dereference" warning regression from 7.1 onwards
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 25 12:10:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83990
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
namespace b {
typedef long unsigned c;
}
void *operator new(b::c, void *) noexcept;
namespace b {
template < typename d > d *e(d &) noexcept;
template < typename d, d f > struct g { static constexpr d h = f; };
typedef g< bool, false > i;
template < bool, typename, typename > struct aa;
template < typename... > struct j;
template < typename k, typename l > struct j< k, l > : aa< 1, k, l > {};
template < typename... > struct ab;
template < typename k, typename l > struct ab< k, l > : aa< k::h, l, k >::ac
{};
template < typename ad > struct m : g< bool, !ad::h > {};
struct ae : i {};
template < typename d > struct n : j< ae, d >::ac {};
struct t {
template < typename > static g< bool, true > ag(int);
};
template < typename d > struct ah : t { typedef decltype(ag< d >(0)) ac; };
struct aj : ah< int >::ac {};
struct u {
template < typename, typename > static g< bool, true > ag(int);
};
template < typename d, typename o > struct w : u {
typedef decltype(ag< d, o >(0)) ac;
};
template < typename o > struct p : ab< aj, w< int, o > > {};
template < typename d, typename > struct q : aa< n< d >::h, int, p< int > > {};
template < typename o > struct r : q< int, o >::ac {};
template < typename... > struct ak;
template < typename d, typename o > struct ak< d, o > : r< o > {};
template < typename, typename... al > struct am : ak< int, al... >::ac {};
template < typename d > struct ao : g< bool, noexcept(d()) > {};
template < typename, typename... al >
struct ap : ab< am< int, al... >, ao< al... > > {};
template < typename d > struct aq : ap< d, d > {};
template < typename d > struct ar : aq< d > {};
template < bool, typename at, typename > struct aa { typedef at ac; };
template < typename at, typename au > struct aa< false, at, au > {
typedef au ac;
};
template < typename av > struct aw { using ac = av; };
template < typename av, template < typename > class > using ay = aw< av >;
template < typename av, template < typename > class ax >
using az = typename ay< av, ax >::ac;
template < typename d > d ba(d &bb) { return static_cast< d && >(bb); }
template < typename d > d bc(d);
struct bd : ab< m< ar< int > >, int > {};
template < typename > struct be;
template < typename d > struct be< d * > { typedef d bg; };
template < typename bi > class bj {
bi bk;
public:
typedef typename be< bi >::bg &&bg;
bj(bi) : bk() {}
bg operator*() { return bg(*bk); }
void operator++() { ++bk; }
};
template < typename bi, typename bo = typename aa< bd::h, bi, bj< bi > >::ac >
bo __make_move_if_noexcept_iterator(bi bp) {
return bp;
}
template < typename d > class allocator {
long bq;
typedef d bf;
template < typename > struct br { typedef allocator bs; };
};
struct bt {
template < typename d > struct bu {
using ac = typename d::template br< int >::bs;
};
template < typename d > using bv = typename d::bw;
};
template < typename bx, typename > using by = typename bt::bu< bx >::ac;
template < typename bx > struct bz : bt {
using bw = az< typename bx::bf *, bv >;
template < typename d > using ca = by< bx, d >;
};
}
template < typename bx > struct cb : b::bz< bx > {
template < typename > struct br {
typedef typename b::bz< bx >::template ca< int > bs;
};
};
namespace b {
template < typename > class Trans_NS_d_cc {
public:
typedef long bq;
struct cg : cb< allocator< char > >::br< int >::bs {
cg(cb< br< int >::bs >::bw, allocator);
cb< br< int >::bs >::bw ch;
} ci;
void ck(bq);
cb< cb< allocator< char > >::br< int >::bs >::bw cj() { return ci.ch; }
cb< cb< allocator< char > >::br< int >::bs >::bw cl();
bool cm() { return cj(); }
cb< allocator< char > >::br< int >::bs cn();
Trans_NS_d_cc(Trans_NS_d_cc &&co) noexcept : ci(cl(), bc(cn())) {
if (co.cm())
ck(length());
}
bq length();
};
template < typename cp, typename... al > void cq(cp *cr, al &&... cs) {
new (cr) cp(ba(cs)...);
}
struct ct {
template < typename cu, typename cv > static cv cw(cu cx, cv) {
cv cy;
try {
for (;; ++cx)
cq(e(*cy), *cx);
} catch (...) {
}
return cy;
}
};
template < typename cu, typename cv > void cz(cu cx, cv db) { ct::cw(cx, db); }
template < typename cu, typename cv, typename d >
void dc(cu cx, cu , cv db, d) {
cz(cx, db);
}
template < typename > struct dd {
typedef allocator< Trans_NS_d_cc< char > > de;
typedef cb< de >::bw bw;
struct {
bw df;
bw dg;
} di;
};
template < typename > class dj : dd< allocator< char > > {
public:
void dl();
template < typename cv > void dm(c, cv cx, cv da) {
bw db;
try {
dc(cx, da, db, 0);
} catch (...) {
}
}
};
c dl_dn;
template < typename d > void dj< d >::dl() {
dm(dl_dn, __make_move_if_noexcept_iterator(di.df),
__make_move_if_noexcept_iterator(di.dg));
}
}
void a() {
b::dj< int > s;
s.dl();
}
More information about the Gcc-bugs
mailing list