Re: [C++ Patch/RFC] PR 56100

2015-04-01 Thread Jason Merrill
On 04/01/2015 06:12 AM, Marek Polacek wrote: On Wed, Apr 01, 2015 at 12:02:36PM +0200, Paolo Carlini wrote: --- cp/pt.c (revision 221795) +++ cp/pt.c (working copy) @@ -20773,6 +20773,13 @@ current_instantiation (void) return current_tinst_level; } +bool +instantiating_current_fun

Re: [C++ Patch/RFC] PR 56100

2015-04-01 Thread Marek Polacek
On Wed, Apr 01, 2015 at 12:02:36PM +0200, Paolo Carlini wrote: > --- cp/pt.c (revision 221795) > +++ cp/pt.c (working copy) > @@ -20773,6 +20773,13 @@ current_instantiation (void) >return current_tinst_level; > } > > +bool > +instantiating_current_function_p (void) > +{ > + return (curr

Re: [C++ Patch/RFC] PR 56100

2015-04-01 Thread Paolo Carlini
Hi, On 03/31/2015 09:13 PM, Jason Merrill wrote: On 03/31/2015 01:14 PM, Paolo Carlini wrote: Note, I took the idea of allowing for current_instantiation ()->decl != current_function_decl from some code prepared by Dodji for -Wunused-local-typedefs Let's make this a predicate function. Indee

Re: [C++ Patch/RFC] PR 56100

2015-03-31 Thread Jason Merrill
On 03/31/2015 01:14 PM, Paolo Carlini wrote: Note, I took the idea of allowing for current_instantiation ()->decl != current_function_decl from some code prepared by Dodji for -Wunused-local-typedefs Let's make this a predicate function. Jason

[C++ Patch/RFC] PR 56100

2015-03-31 Thread Paolo Carlini
Hi, thus, in order to not warn -Wshadow at instantiation time, I figured out the below. Tested x86_64-linux. Note, I took the idea of allowing for current_instantiation ()->decl != current_function_decl from some code prepared by Dodji for -Wunused-local-typedefs: I'm not 100% sure it's nece