Re: [committed] analyzer: detect malloc, free, calloc within "std" [PR93959]

2020-03-04 Thread Bernhard Reutner-Fischer
On Wed, 04 Mar 2020 11:16:35 -0500 David Malcolm wrote: > On Wed, 2020-03-04 at 11:05 -0500, Marek Polacek wrote: > > On Wed, Mar 04, 2020 at 04:54:54PM +0100, Bernhard Reutner-Fischer > > wrote: > > > On Mon, 2 Mar 2020 16:48:26 -0500 > > > David Malcolm wrote: > > > > > > > +static inlin

Re: [committed] analyzer: detect malloc, free, calloc within "std" [PR93959]

2020-03-04 Thread David Malcolm
On Wed, 2020-03-04 at 11:05 -0500, Marek Polacek wrote: > On Wed, Mar 04, 2020 at 04:54:54PM +0100, Bernhard Reutner-Fischer > wrote: > > On Mon, 2 Mar 2020 16:48:26 -0500 > > David Malcolm wrote: > > > > > +static inline bool > > > +is_std_function_p (const_tree fndecl) > > > +{ > > > + tree n

Re: [committed] analyzer: detect malloc, free, calloc within "std" [PR93959]

2020-03-04 Thread David Malcolm
On Wed, 2020-03-04 at 16:54 +0100, Bernhard Reutner-Fischer wrote: > On Mon, 2 Mar 2020 16:48:26 -0500 > David Malcolm wrote: > > > +static inline bool > > +is_std_function_p (const_tree fndecl) > > +{ > > + tree name_decl = DECL_NAME (fndecl); > > + if (!name_decl) > > +return false; > >

Re: [committed] analyzer: detect malloc, free, calloc within "std" [PR93959]

2020-03-04 Thread Marek Polacek
On Wed, Mar 04, 2020 at 04:54:54PM +0100, Bernhard Reutner-Fischer wrote: > On Mon, 2 Mar 2020 16:48:26 -0500 > David Malcolm wrote: > > > +static inline bool > > +is_std_function_p (const_tree fndecl) > > +{ > > + tree name_decl = DECL_NAME (fndecl); > > + if (!name_decl) > > +return fals

Re: [committed] analyzer: detect malloc, free, calloc within "std" [PR93959]

2020-03-04 Thread Bernhard Reutner-Fischer
On Mon, 2 Mar 2020 16:48:26 -0500 David Malcolm wrote: > +static inline bool > +is_std_function_p (const_tree fndecl) > +{ > + tree name_decl = DECL_NAME (fndecl); > + if (!name_decl) > +return false; > + if (!DECL_CONTEXT (fndecl)) > +return false; > + if (TREE_CODE (DECL_CONTEXT (f

[committed] analyzer: detect malloc, free, calloc within "std" [PR93959]

2020-03-02 Thread David Malcolm
PR analyzer/93959 reported that g++.dg/analyzer/malloc.C was failing with no output on Solaris. The issue is that there has "using std::free;", converting all the "free" calls to std::free, which fails the name-matching via is_named_call_p. This patch implements an is_std_named_call_p variant of